Revision 38d78e587d4960d0db94add518d27ee74bad2301 authored by Vladimir Davydov on 22 March 2013, 22:04:51 UTC, committed by Linus Torvalds on 22 March 2013, 23:41:21 UTC
mnt_drop_write() must be called only if mnt_want_write() succeeded,
otherwise the mnt_writers counter will diverge.

mnt_writers counters are used to check if remounting FS as read-only is
OK, so after an extra mnt_drop_write() call, it would be impossible to
remount mqueue FS as read-only.  Besides, on umount a warning would be
printed like this one:

  =====================================
  [ BUG: bad unlock balance detected! ]
  3.9.0-rc3 #5 Not tainted
  -------------------------------------
  a.out/12486 is trying to release lock (sb_writers) at:
  mnt_drop_write+0x1f/0x30
  but there are no more locks to release!

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Cc: Doug Ledford <dledford@redhat.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent ca4b3f3
History
File Mode Size
9p
adfs
affs
afs
autofs4
befs
bfs
btrfs
cachefiles
ceph
cifs
coda
configfs
cramfs
debugfs
devpts
dlm
ecryptfs
efs
exofs
exportfs
ext2
ext3
ext4
f2fs
fat
freevxfs
fscache
fuse
gfs2
hfs
hfsplus
hostfs
hpfs
hppfs
hugetlbfs
isofs
jbd
jbd2
jffs2
jfs
lockd
logfs
minix
ncpfs
nfs
nfs_common
nfsd
nilfs2
nls
notify
ntfs
ocfs2
omfs
openpromfs
proc
pstore
qnx4
qnx6
quota
ramfs
reiserfs
romfs
squashfs
sysfs
sysv
ubifs
udf
ufs
xfs
Kconfig -rw-r--r-- 5.9 KB
Kconfig.binfmt -rw-r--r-- 6.7 KB
Makefile -rw-r--r-- 4.1 KB
aio.c -rw-r--r-- 45.7 KB
anon_inodes.c -rw-r--r-- 6.4 KB
attr.c -rw-r--r-- 7.0 KB
bad_inode.c -rw-r--r-- 7.7 KB
binfmt_aout.c -rw-r--r-- 11.7 KB
binfmt_elf.c -rw-r--r-- 57.8 KB
binfmt_elf_fdpic.c -rw-r--r-- 48.6 KB
binfmt_em86.c -rw-r--r-- 2.7 KB
binfmt_flat.c -rw-r--r-- 26.7 KB
binfmt_misc.c -rw-r--r-- 15.0 KB
binfmt_script.c -rw-r--r-- 2.7 KB
binfmt_som.c -rw-r--r-- 7.1 KB
bio-integrity.c -rw-r--r-- 20.5 KB
bio.c -rw-r--r-- 40.3 KB
block_dev.c -rw-r--r-- 42.0 KB
buffer.c -rw-r--r-- 87.2 KB
char_dev.c -rw-r--r-- 14.0 KB
compat.c -rw-r--r-- 43.6 KB
compat_binfmt_elf.c -rw-r--r-- 3.6 KB
compat_ioctl.c -rw-r--r-- 45.5 KB
coredump.c -rw-r--r-- 16.5 KB
coredump.h -rw-r--r-- 106 bytes
dcache.c -rw-r--r-- 78.5 KB
dcookies.c -rw-r--r-- 6.8 KB
direct-io.c -rw-r--r-- 37.4 KB
drop_caches.c -rw-r--r-- 1.5 KB
eventfd.c -rw-r--r-- 11.3 KB
eventpoll.c -rw-r--r-- 54.7 KB
exec.c -rw-r--r-- 39.0 KB
fcntl.c -rw-r--r-- 16.3 KB
fhandle.c -rw-r--r-- 6.5 KB
fifo.c -rw-r--r-- 3.2 KB
file.c -rw-r--r-- 23.4 KB
file_table.c -rw-r--r-- 12.4 KB
filesystems.c -rw-r--r-- 6.4 KB
fs-writeback.c -rw-r--r-- 39.6 KB
fs_struct.c -rw-r--r-- 3.3 KB
generic_acl.c -rw-r--r-- 3.9 KB
inode.c -rw-r--r-- 48.5 KB
internal.h -rw-r--r-- 3.0 KB
ioctl.c -rw-r--r-- 15.5 KB
ioprio.c -rw-r--r-- 5.0 KB
libfs.c -rw-r--r-- 25.7 KB
locks.c -rw-r--r-- 58.6 KB
mbcache.c -rw-r--r-- 16.4 KB
mount.h -rw-r--r-- 2.3 KB
mpage.c -rw-r--r-- 20.0 KB
namei.c -rw-r--r-- 99.8 KB
namespace.c -rw-r--r-- 67.6 KB
no-block.c -rw-r--r-- 688 bytes
open.c -rw-r--r-- 25.6 KB
pipe.c -rw-r--r-- 28.9 KB
pnode.c -rw-r--r-- 8.8 KB
pnode.h -rw-r--r-- 1.5 KB
posix_acl.c -rw-r--r-- 9.2 KB
proc_namespace.c -rw-r--r-- 7.5 KB
read_write.c -rw-r--r-- 21.8 KB
read_write.h -rw-r--r-- 632 bytes
readdir.c -rw-r--r-- 6.8 KB
select.c -rw-r--r-- 24.0 KB
seq_file.c -rw-r--r-- 19.6 KB
signalfd.c -rw-r--r-- 8.3 KB
splice.c -rw-r--r-- 46.3 KB
stack.c -rw-r--r-- 2.5 KB
stat.c -rw-r--r-- 11.3 KB
statfs.c -rw-r--r-- 5.3 KB
super.c -rw-r--r-- 34.6 KB
sync.c -rw-r--r-- 10.6 KB
timerfd.c -rw-r--r-- 9.6 KB
utimes.c -rw-r--r-- 5.7 KB
xattr.c -rw-r--r-- 23.5 KB
xattr_acl.c -rw-r--r-- 4.3 KB

back to top