Fix zfs_open() to skip zil_async_to_sync() for the snapshot#18091
Fix zfs_open() to skip zil_async_to_sync() for the snapshot#18091behlendorf merged 1 commit intoopenzfs:masterfrom
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 <jitendra.patidar@nutanix.com>
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.
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. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Jitendra Patidar <jitendra.patidar@nutanix.com> Closes openzfs#18091
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. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Jitendra Patidar <jitendra.patidar@nutanix.com> Closes openzfs#18091
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. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Jitendra Patidar <jitendra.patidar@nutanix.com> Closes openzfs#18091
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. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Jitendra Patidar <jitendra.patidar@nutanix.com> Closes openzfs#18091
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. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Jitendra Patidar <jitendra.patidar@nutanix.com> Closes openzfs#18091
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. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Jitendra Patidar <jitendra.patidar@nutanix.com> Closes #18091
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. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Jitendra Patidar <jitendra.patidar@nutanix.com> Closes openzfs#18091
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. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Jitendra Patidar <jitendra.patidar@nutanix.com> Closes openzfs#18091
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.