Skip to content

Commit 2277ef2

Browse files
committed
Linux: zfs_sync: remove explicit suspend check
Since zil_commit_flags(NOW) will always return error if the pool is suspended, there's no need for a separate suspend check here. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Signed-off-by: Rob Norris <[email protected]>
1 parent 8837500 commit 2277ef2

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

module/os/linux/zfs/zfs_vfsops.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -279,16 +279,11 @@ zfs_sync(struct super_block *sb, int wait, cred_t *cr)
279279
return (err);
280280

281281
/*
282-
* If the pool is suspended, just return an error. This is to help
283-
* with shutting down with pools suspended, as we don't want to block
284-
* in that case.
282+
* Sync any pending writes, but do not block if the pool is suspended.
283+
* This is to help with shutting down with pools suspended, as we don't
284+
* want to block in that case.
285285
*/
286-
if (spa_suspended(zfsvfs->z_os->os_spa)) {
287-
zfs_exit(zfsvfs, FTAG);
288-
return (SET_ERROR(EIO));
289-
}
290-
291-
err = zil_commit(zfsvfs->z_log, 0);
286+
err = zil_commit_flags(zfsvfs->z_log, 0, ZIL_COMMIT_NOW);
292287
zfs_exit(zfsvfs, FTAG);
293288

294289
return (err);

0 commit comments

Comments
 (0)