-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix zfs_open() to skip zil_async_to_sync() for the snapshot #18091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@behlendorf Actually, we need to change zfs_close() as well to prevent decrement z_sync_cnt for snapshot. |
Fix zfs_open() to skip zil_async_to_sync() for the snapshot, as it won't have any transactions. zfsvfs->z_log is NULL for the snapshot. Signed-off-by: Jitendra Patidar <[email protected]>
0bde55c to
aad09a2
Compare
|
While I agree that this code should not make much sense for snapshots, I don't see here an explanation of why |
Following code in zfs_domount() doesn’t initialise zfsvfs->z_log for the snapshot. |
amotin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. OK. Though I wonder whether snapshots really need to be that special...
Fix zfs_open() to skip zil_async_to_sync() for the snapshot, as it won't have any transactions. zfsvfs->z_log is NULL for the snapshot.
Motivation and Context
zfs_open()->zil_async_to_sync() gets kernel panic due to NULL pointer reference for the snapshot while referring zilog->zl_spa;
Description
How Has This Been Tested?
Opening a file on snapshot "<dataset mountpoint>/.zfs/snapshot/<file>" wiht O_SYNC flag hits a panic.
Validated a fix with same steps.
Types of changes
Checklist:
Signed-off-by.