Make sure that all callers of remount hold s_umount exclusive

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, June 11, 2009 - 8:59 pm

Gitweb:     http://git.kernel.org/linus/443b94baaa16771e98b29ca7c24f1e305738ffca
Commit:     443b94baaa16771e98b29ca7c24f1e305738ffca
Parent:     5af7926ff33b68b3ba46531471c6e0564b285efc
Author:     Al Viro <viro@zeniv.linux.org.uk>
AuthorDate: Tue May 5 23:48:50 2009 -0400
Committer:  Al Viro <viro@zeniv.linux.org.uk>
CommitDate: Thu Jun 11 21:36:07 2009 -0400

    Make sure that all callers of remount hold s_umount exclusive
    
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/super.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/super.c b/fs/super.c
index cb19fff..49f670c 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -579,7 +579,7 @@ static void do_emergency_remount(struct work_struct *work)
 	list_for_each_entry(sb, &super_blocks, s_list) {
 		sb->s_count++;
 		spin_unlock(&sb_lock);
-		down_read(&sb->s_umount);
+		down_write(&sb->s_umount);
 		if (sb->s_root && sb->s_bdev && !(sb->s_flags & MS_RDONLY)) {
 			/*
 			 * ->remount_fs needs lock_kernel().
@@ -590,7 +590,8 @@ static void do_emergency_remount(struct work_struct *work)
 			do_remount_sb(sb, MS_RDONLY, NULL, 1);
 			unlock_kernel();
 		}
-		drop_super(sb);
+		up_write(&sb->s_umount);
+		put_super(sb);
 		spin_lock(&sb_lock);
 	}
 	spin_unlock(&sb_lock);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Make sure that all callers of remount hold s_umount exclusive, Linux Kernel Mailing ..., (Thu Jun 11, 8:59 pm)