mirror of
				https://git.proxmox.com/git/mirror_zfs.git
				synced 2025-10-26 18:05:04 +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
							
								
									d944641502
								
							
						
					
					
						commit
						08cec6532e
					
				| @ -279,12 +279,13 @@ zfs_sync(struct super_block *sb, int wait, cred_t *cr) | |||||||
| 		return (err); | 		return (err); | ||||||
| 
 | 
 | ||||||
| 	/*
 | 	/*
 | ||||||
| 	 * If the system is shutting down, then skip any | 	 * If the pool is suspended, just return an error. This is to help | ||||||
| 	 * filesystems which may exist on a suspended pool. | 	 * with shutting down with pools suspended, as we don't want to block | ||||||
|  | 	 * in that case. | ||||||
| 	 */ | 	 */ | ||||||
| 	if (spa_suspended(zfsvfs->z_os->os_spa)) { | 	if (spa_suspended(zfsvfs->z_os->os_spa)) { | ||||||
| 		zfs_exit(zfsvfs, FTAG); | 		zfs_exit(zfsvfs, FTAG); | ||||||
| 		return (0); | 		return (SET_ERROR(EIO)); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	zil_commit(zfsvfs->z_log, 0); | 	zil_commit(zfsvfs->z_log, 0); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Rob Norris
						Rob Norris