linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.35-rc4: mount results with and without MS_SILENT differ
@ 2011-03-14  4:20 Denys Vlasenko
  2011-03-25  3:47 ` Chuck Ebbert
  0 siblings, 1 reply; 11+ messages in thread
From: Denys Vlasenko @ 2011-03-14  4:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexander Viro, Roman Borisov, Alexander Shishkin

This issue was discovered by users of busybox.
Apparently, mount() calls with and without MS_SILENT

The following script was run in an empty test directory:

mkdir -p mount.dir mount.shared1 mount.shared2
touch mount.dir/a mount.dir/b
mount -vv --bind         mount.shared1 mount.shared1
mount -vv --make-rshared mount.shared1
mount -vv --bind         mount.shared2 mount.shared2
mount -vv --make-rshared mount.shared2
mount -vv --bind mount.shared2 mount.shared1
mount -vv --bind mount.dir     mount.shared2
ls -R mount.dir mount.shared1 mount.shared2
umount mount.dir mount.shared1 mount.shared2 2>/dev/null
umount mount.dir mount.shared1 mount.shared2 2>/dev/null
umount mount.dir mount.shared1 mount.shared2 2>/dev/null
rm -f mount.dir/a mount.dir/b mount.dir/c
rmdir mount.dir mount.shared1 mount.shared2


mount -vv was used to show the mount() call arguments and result.
Output shows that flag argument has 0x00008000 = MS_SILENT bit:

mount: mount('mount.shared1','mount.shared1','(null)',0x00009000,'(null)'):0
mount: mount('','mount.shared1','',0x0010c000,''):0
mount: mount('mount.shared2','mount.shared2','(null)',0x00009000,'(null)'):0
mount: mount('','mount.shared2','',0x0010c000,''):0
mount: mount('mount.shared2','mount.shared1','(null)',0x00009000,'(null)'):0
mount: mount('mount.dir','mount.shared2','(null)',0x00009000,'(null)'):0
mount.dir:
a
b

mount.shared1:

mount.shared2:
a
b


After adding --loud option to remove MS_SILENT bit from just one mount cmd:

mkdir -p mount.dir mount.shared1 mount.shared2
touch mount.dir/a mount.dir/b
mount -vv --bind         mount.shared1 mount.shared1 2>&1
mount -vv --make-rshared mount.shared1               2>&1
mount -vv --bind         mount.shared2 mount.shared2 2>&1
mount -vv --loud --make-rshared mount.shared2               2>&1  # <-HERE
mount -vv --bind mount.shared2 mount.shared1         2>&1
mount -vv --bind mount.dir     mount.shared2         2>&1
ls -R mount.dir mount.shared1 mount.shared2      2>&1
umount mount.dir mount.shared1 mount.shared2 2>/dev/null
umount mount.dir mount.shared1 mount.shared2 2>/dev/null
umount mount.dir mount.shared1 mount.shared2 2>/dev/null
rm -f mount.dir/a mount.dir/b mount.dir/c
rmdir mount.dir mount.shared1 mount.shared2


The result is different now - look closely at mount.shared1 directory listing.
Now it does show files 'a' and 'b':

mount: mount('mount.shared1','mount.shared1','(null)',0x00009000,'(null)'):0
mount: mount('','mount.shared1','',0x0010c000,''):0
mount: mount('mount.shared2','mount.shared2','(null)',0x00009000,'(null)'):0
mount: mount('','mount.shared2','',0x00104000,''):0
mount: mount('mount.shared2','mount.shared1','(null)',0x00009000,'(null)'):0
mount: mount('mount.dir','mount.shared2','(null)',0x00009000,'(null)'):0

mount.dir:
a
b

mount.shared1:
a
b

mount.shared2:
a
b


I am not asking whether mount command should or should not use MS_SILENT bit.
It's an important question, but it doesn't belong to lkml.

My question is, intuitively, MS_SILENT should only affect (suppress)
kernel messages, it should never affect the outcome of the mount() call, right?

Here it is obviously not the case - the behavior is different. Is it a bug?

-- 
vda

^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <cover.1303304011.git.ext-roman.borisov@nokia.com>]

end of thread, other threads:[~2011-04-22 11:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-14  4:20 2.6.35-rc4: mount results with and without MS_SILENT differ Denys Vlasenko
2011-03-25  3:47 ` Chuck Ebbert
2011-03-26 21:43   ` Denys Vlasenko
2011-04-01 14:48     ` [PATCH] fs: bound mount propagation fix Roman Borisov
2011-04-12 10:28       ` Roman Borisov
2011-04-19 21:04       ` Andrew Morton
2011-04-20 11:51         ` Roman Borisov
     [not found] <cover.1303304011.git.ext-roman.borisov@nokia.com>
2011-04-20 14:11 ` [PATCH v2] " Roman Borisov
2011-04-21 20:04   ` [PATCH v3] " Andrew Morton
2011-04-22  9:02     ` Roman Borisov
2011-04-22 11:05     ` [PATCH v4] fs: namespacec " Roman Borisov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).