diff options
Diffstat (limited to 'module/os/linux/zfs/zpl_file.c')
-rw-r--r-- | module/os/linux/zfs/zpl_file.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/module/os/linux/zfs/zpl_file.c b/module/os/linux/zfs/zpl_file.c index b0d9f37a3..f6bdfd08b 100644 --- a/module/os/linux/zfs/zpl_file.c +++ b/module/os/linux/zfs/zpl_file.c @@ -195,9 +195,12 @@ zpl_fsync(struct file *filp, loff_t start, loff_t end, int datasync) * zfs_putpage() respectively. */ if (atomic_load_32(&zp->z_async_writes_cnt) > 0) { - ZPL_ENTER(zfsvfs); + if ((error = zpl_enter(zfsvfs, FTAG)) != 0) { + atomic_dec_32(&zp->z_sync_writes_cnt); + return (error); + } zil_commit(zfsvfs->z_log, zp->z_id); - ZPL_EXIT(zfsvfs); + zpl_exit(zfsvfs, FTAG); } error = filemap_write_and_wait_range(inode->i_mapping, start, end); @@ -752,10 +755,11 @@ zpl_writepages(struct address_space *mapping, struct writeback_control *wbc) enum writeback_sync_modes sync_mode; int result; - ZPL_ENTER(zfsvfs); + if ((result = zpl_enter(zfsvfs, FTAG)) != 0) + return (result); if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) wbc->sync_mode = WB_SYNC_ALL; - ZPL_EXIT(zfsvfs); + zpl_exit(zfsvfs, FTAG); sync_mode = wbc->sync_mode; /* @@ -769,11 +773,11 @@ zpl_writepages(struct address_space *mapping, struct writeback_control *wbc) wbc->sync_mode = WB_SYNC_NONE; result = write_cache_pages(mapping, wbc, zpl_putpage, &for_sync); if (sync_mode != wbc->sync_mode) { - ZPL_ENTER(zfsvfs); - ZPL_VERIFY_ZP(zp); + if ((result = zpl_enter_verify_zp(zfsvfs, zp, FTAG)) != 0) + return (result); if (zfsvfs->z_log != NULL) zil_commit(zfsvfs->z_log, zp->z_id); - ZPL_EXIT(zfsvfs); + zpl_exit(zfsvfs, FTAG); /* * We need to call write_cache_pages() again (we can't just |