Skip to contentSkip to conversation

VFS: BKL is not required for remount_fs()

PATCH New Vasily Averin 1 participant 1 message Oct 30, 2006 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 VFS: BKL is not required for remount_fs()

From: Vasily Averin <[email protected]>

according to Documentation/filesystems/Locking remount_fs() is not requires BKL

fs/namespace.c renamed from fs/namespace.c.blkrm +0 -2
@@ -594,10 +594,8 @@ static int do_umount(struct vfsmount *mn
 		 */
 		down_write(&sb->s_umount);
 		if (!(sb->s_flags & MS_RDONLY)) {
-			lock_kernel();
 			DQUOT_OFF(sb);
 			retval = do_remount_sb(sb, MS_RDONLY, NULL, 0);
-			unlock_kernel();
 		}
 		up_write(&sb->s_umount);
 		return retval;
fs/super.c renamed from fs/super.c.blkrm +1 -9
@@ -609,16 +609,8 @@ static void do_emergency_remount(unsigne
 		sb->s_count++;
 		spin_unlock(&sb_lock);
 		down_read(&sb->s_umount);
-		if (sb->s_root && sb->s_bdev && !(sb->s_flags & MS_RDONLY)) {
-			/*
-			 * ->remount_fs needs lock_kernel().
-			 *
-			 * What lock protects sb->s_flags??
-			 */
-			lock_kernel();
+		if (sb->s_root && sb->s_bdev && !(sb->s_flags & MS_RDONLY))
 			do_remount_sb(sb, MS_RDONLY, NULL, 1);
-			unlock_kernel();
-		}
 		drop_super(sb);
 		spin_lock(&sb_lock);
 	}