From 90a1e13df2a07739a3c06885d2949f305f18c65f Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Tue, 17 Jun 2025 11:33:12 +1000 Subject: [PATCH] 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. Reviewed-by: Brian Behlendorf Reviewed-by: Alexander Motin Signed-off-by: Rob Norris Closes #17398 --- module/os/linux/zfs/zfs_vfsops.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/module/os/linux/zfs/zfs_vfsops.c b/module/os/linux/zfs/zfs_vfsops.c index 6ba12cff7..cd606e667 100644 --- a/module/os/linux/zfs/zfs_vfsops.c +++ b/module/os/linux/zfs/zfs_vfsops.c @@ -279,16 +279,11 @@ zfs_sync(struct super_block *sb, int wait, cred_t *cr) return (err); /* - * If the pool is suspended, just return an error. This is to help - * with shutting down with pools suspended, as we don't want to block - * in that case. + * Sync any pending writes, but do not block if the pool is suspended. + * This is to help with shutting down with pools suspended, as we don't + * want to block in that case. */ - if (spa_suspended(zfsvfs->z_os->os_spa)) { - zfs_exit(zfsvfs, FTAG); - return (SET_ERROR(EIO)); - } - - err = zil_commit(zfsvfs->z_log, 0); + err = zil_commit_flags(zfsvfs->z_log, 0, ZIL_COMMIT_NOW); zfs_exit(zfsvfs, FTAG); return (err);