mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-06-25 02:28:01 +03:00
zfs_sync: return error when pool suspends
If the pool is suspended, we'll just block in zil_commit(). If the system is shutting down, blocking wouldn't help anyone. So, we should keep this test for now, but at least return an error for anyone who is actually interested. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Paul Dagnelie <paul.dagnelie@klarasystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Rob Norris <rob.norris@klarasystems.com> Closes #17420
This commit is contained in:
parent
52352dd748
commit
e3f5e317e0
@ -279,12 +279,13 @@ zfs_sync(struct super_block *sb, int wait, cred_t *cr)
|
||||
return (err);
|
||||
|
||||
/*
|
||||
* If the system is shutting down, then skip any
|
||||
* filesystems which may exist on a suspended pool.
|
||||
* 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.
|
||||
*/
|
||||
if (spa_suspended(zfsvfs->z_os->os_spa)) {
|
||||
zfs_exit(zfsvfs, FTAG);
|
||||
return (0);
|
||||
return (SET_ERROR(EIO));
|
||||
}
|
||||
|
||||
zil_commit(zfsvfs->z_log, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user