xfs: Convert to new freezing code

Generic code now blocks all writers from standard write paths. So we add
blocking of all writers coming from ioctl (we get a protection of ioctl against
racing remount read-only as a bonus) and convert xfs_file_aio_write() to a
non-racy freeze protection. We also keep freeze protection on transaction
start to block internal filesystem writes such as removal of preallocated
blocks.

CC: Ben Myers <bpm@sgi.com>
CC: Alex Elder <elder@kernel.org>
CC: xfs@oss.sgi.com
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Jan Kara
2012-06-12 16:20:39 +02:00
committed by Al Viro
parent 8e8ad8a57c
commit d9457dc056
10 changed files with 109 additions and 16 deletions

View File

@@ -1544,7 +1544,7 @@ xfs_unmountfs(
int
xfs_fs_writable(xfs_mount_t *mp)
{
return !(xfs_test_for_freeze(mp) || XFS_FORCED_SHUTDOWN(mp) ||
return !(mp->m_super->s_writers.frozen || XFS_FORCED_SHUTDOWN(mp) ||
(mp->m_flags & XFS_MOUNT_RDONLY));
}