aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-05-06 10:43:07 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-11 21:36:08 -0400
commitbbd6851a3213a525128473e978b692ab6ac11aba (patch)
tree8ebddebadd8992871ab98456187cb00849a82058 /fs/ufs
parent6cfd0148425e528b859b26e436b01f23f6926224 (diff)
Push lock_super() into the ->remount_fs() of filesystems that care about it
Note that since we can't run into contention between remount_fs and write_super (due to exclusion on s_umount), we have to care only about filesystems that touch lock_super() on their own. Out of those ext3, ext4, hpfs, sysv and ufs do need it; fat doesn't since its ->remount_fs() only accesses assign-once data (basically, it's "we have no atime on directories and only have atime on files for vfat; force nodiratime and possibly noatime into *flags"). [folded a build fix from hch] Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ufs')
-rw-r--r--fs/ufs/super.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 2b4d2b6234df..a5ecabfdc976 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -1181,6 +1181,7 @@ static int ufs_remount (struct super_block *sb, int *mount_flags, char *data)
1181 unsigned new_mount_opt, ufstype; 1181 unsigned new_mount_opt, ufstype;
1182 unsigned flags; 1182 unsigned flags;
1183 1183
1184 lock_super(sb);
1184 uspi = UFS_SB(sb)->s_uspi; 1185 uspi = UFS_SB(sb)->s_uspi;
1185 flags = UFS_SB(sb)->s_flags; 1186 flags = UFS_SB(sb)->s_flags;
1186 usb1 = ubh_get_usb_first(uspi); 1187 usb1 = ubh_get_usb_first(uspi);
@@ -1193,17 +1194,21 @@ static int ufs_remount (struct super_block *sb, int *mount_flags, char *data)
1193 ufstype = UFS_SB(sb)->s_mount_opt & UFS_MOUNT_UFSTYPE; 1194 ufstype = UFS_SB(sb)->s_mount_opt & UFS_MOUNT_UFSTYPE;
1194 new_mount_opt = 0; 1195 new_mount_opt = 0;
1195 ufs_set_opt (new_mount_opt, ONERROR_LOCK); 1196 ufs_set_opt (new_mount_opt, ONERROR_LOCK);
1196 if (!ufs_parse_options (data, &new_mount_opt)) 1197 if (!ufs_parse_options (data, &new_mount_opt)) {
1198 unlock_super(sb);
1197 return -EINVAL; 1199 return -EINVAL;
1200 }
1198 if (!(new_mount_opt & UFS_MOUNT_UFSTYPE)) { 1201 if (!(new_mount_opt & UFS_MOUNT_UFSTYPE)) {
1199 new_mount_opt |= ufstype; 1202 new_mount_opt |= ufstype;
1200 } else if ((new_mount_opt & UFS_MOUNT_UFSTYPE) != ufstype) { 1203 } else if ((new_mount_opt & UFS_MOUNT_UFSTYPE) != ufstype) {
1201 printk("ufstype can't be changed during remount\n"); 1204 printk("ufstype can't be changed during remount\n");
1205 unlock_super(sb);
1202 return -EINVAL; 1206 return -EINVAL;
1203 } 1207 }
1204 1208
1205 if ((*mount_flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) { 1209 if ((*mount_flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) {
1206 UFS_SB(sb)->s_mount_opt = new_mount_opt; 1210 UFS_SB(sb)->s_mount_opt = new_mount_opt;
1211 unlock_super(sb);
1207 return 0; 1212 return 0;
1208 } 1213 }
1209 1214
@@ -1228,6 +1233,7 @@ static int ufs_remount (struct super_block *sb, int *mount_flags, char *data)
1228#ifndef CONFIG_UFS_FS_WRITE 1233#ifndef CONFIG_UFS_FS_WRITE
1229 printk("ufs was compiled with read-only support, " 1234 printk("ufs was compiled with read-only support, "
1230 "can't be mounted as read-write\n"); 1235 "can't be mounted as read-write\n");
1236 unlock_super(sb);
1231 return -EINVAL; 1237 return -EINVAL;
1232#else 1238#else
1233 if (ufstype != UFS_MOUNT_UFSTYPE_SUN && 1239 if (ufstype != UFS_MOUNT_UFSTYPE_SUN &&
@@ -1236,16 +1242,19 @@ static int ufs_remount (struct super_block *sb, int *mount_flags, char *data)
1236 ufstype != UFS_MOUNT_UFSTYPE_SUNx86 && 1242 ufstype != UFS_MOUNT_UFSTYPE_SUNx86 &&
1237 ufstype != UFS_MOUNT_UFSTYPE_UFS2) { 1243 ufstype != UFS_MOUNT_UFSTYPE_UFS2) {
1238 printk("this ufstype is read-only supported\n"); 1244 printk("this ufstype is read-only supported\n");
1245 unlock_super(sb);
1239 return -EINVAL; 1246 return -EINVAL;
1240 } 1247 }
1241 if (!ufs_read_cylinder_structures(sb)) { 1248 if (!ufs_read_cylinder_structures(sb)) {
1242 printk("failed during remounting\n"); 1249 printk("failed during remounting\n");
1250 unlock_super(sb);
1243 return -EPERM; 1251 return -EPERM;
1244 } 1252 }
1245 sb->s_flags &= ~MS_RDONLY; 1253 sb->s_flags &= ~MS_RDONLY;
1246#endif 1254#endif
1247 } 1255 }
1248 UFS_SB(sb)->s_mount_opt = new_mount_opt; 1256 UFS_SB(sb)->s_mount_opt = new_mount_opt;
1257 unlock_super(sb);
1249 return 0; 1258 return 0;
1250} 1259}
1251 1260