Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72651cac authored by Jan Kara's avatar Jan Kara Committed by Al Viro
Browse files

fs: Fix imbalance in freeze protection in mark_files_ro()



File descriptors (even those for writing) do not hold freeze protection.
Thus mark_files_ro() must call __mnt_drop_write() to only drop protection
against remount read-only. Calling mnt_drop_write_file() as we do now
results in:

[ BUG: bad unlock balance detected! ]
3.7.0-rc6-00028-g88e75b6 #101 Not tainted
-------------------------------------
kworker/1:2/79 is trying to release lock (sb_writers) at:
[<ffffffff811b33b4>] mnt_drop_write+0x24/0x30
but there are no more locks to release!

Reported-by: default avatarZdenek Kabelac <zkabelac@redhat.com>
CC: stable@vger.kernel.org
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 39e3c955
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -458,8 +458,8 @@ void mark_files_ro(struct super_block *sb)
		spin_unlock(&f->f_lock);
		if (file_check_writeable(f) != 0)
			continue;
		__mnt_drop_write(f->f_path.mnt);
		file_release_write(f);
		mnt_drop_write_file(f);
	} while_file_list_for_each_entry;
	lg_global_unlock(&files_lglock);
}