04 Mar, 2010
40 commits
-
To avoid potential problems with an empty /dev open /dev/console
from rootfs instead of waiting to mount our root filesystem and
mounting it there. This effectively guarantees that there will
be a device node, and it won't be on a filesystem that we will
ever unmount, so there are no issues with leaving /dev/console
open and pinning the filesystem.This is actually more effective than automatically mounting
devtmpfs on /dev because it removes removes the occasionally
problematic assumption that /dev/console exists from the boot
code.With this patch I was able to throw busybox on my /boot partition
(which has no /dev directory) and boot into userspace without
problems.The only possible negative consequence I can think of is that
someone out there deliberately used did not use a character device
that is major 5 minor 2 for /dev/console. Does anyone know of a
situation in which that could make sense?Signed-off-by: Eric W. Biederman
Signed-off-by: Al Viro -
Signed-off-by: André Goddard Rosa
Signed-off-by: Al Viro -
... postponing assignments until they're needed. Doesn't change code size.
Signed-off-by: André Goddard Rosa
Signed-off-by: Al Viro -
It reduces code size:
text data bss dec hex filename
9925 72 16 10013 271d ipc/mqueue-BEFORE.o
9885 72 16 9973 26f5 ipc/mqueue-AFTER.oSigned-off-by: André Goddard Rosa
Signed-off-by: Al Viro -
Code size reduction:
text data bss dec hex filename
9941 72 16 10029 272d ipc/mqueue-BEFORE.o
9925 72 16 10013 271d ipc/mqueue-AFTER.oSigned-off-by: André Goddard Rosa
Signed-off-by: Al Viro -
... and abort earlier if we couldn't allocate the message pointers array,
avoiding the u->mq_bytes accounting logic.It reduces code size:
text data bss dec hex filename
9949 72 16 10037 2735 ipc/mqueue-BEFORE.o
9941 72 16 10029 272d ipc/mqueue-AFTER.oSigned-off-by: André Goddard Rosa
Signed-off-by: Al Viro -
We leak fd on lookup_one_len() failure
Signed-off-by: André Goddard Rosa
Signed-off-by: Al Viro -
rehashing the negative placeholder opens a race with d_lookup();
we unhash it almost immediately (by d_move()), but the race
window is there. Since d_move() doesn't rely on target being
hashed, we don't need that d_rehash() at all.Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
Add a new UMOUNT_NOFOLLOW flag to umount(2). This is needed to prevent
symlink attacks in unprivileged unmounts (fuse, samba, ncpfs).Additionally, return -EINVAL if an unknown flag is used (and specify
an explicitly unused flag: UMOUNT_UNUSED). This makes it possible for
the caller to determine if a flag is supported or not.CC: Eugene Teo
CC: Michael Kerrisk
Signed-off-by: Miklos Szeredi
Signed-off-by: Al Viro -
Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
It hadn't been needed since we'd sanitized the logics in
mark_mounts_for_expiry() (which, in turn, used to be a
rudiment of bad old times when namespace_sem was per-ns).Signed-off-by: Al Viro
-
no more users left outside of fs/*.c (and very few outside of
fs/namespace.c, actually)Signed-off-by: Al Viro
-
passing *any* namespace root to __d_path() as root is equivalent
to just passing it {NULL, NULL}; no need to bother with finding
the root of our namespace in there.Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
Just use dentry_unhash() there
Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
... especially when it only needs (and initializes) .d_name of it
Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
apply function to vfsmounts in set returned by collect_mounts(),
stop if it returns non-zero.Signed-off-by: Al Viro
-
RFC says we need to follow the chain of mounts if there's more
than one stacked on that point.Signed-off-by: Al Viro
-
No need to open-code follow_up() in it and locking can be lighter.
Signed-off-by: Al Viro
-
(mnt,mnt_mountpoint) pair is conceptually wrong; if you want
to use it for generating pathname and for nothing else *and*
if you know that vfsmount tree is unchanging, you can get
away with that, but the right solution for that is (mnt,mnt_root).Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
Analog of is_subdir for vfsmount,dentry pairs, moved from audit_tree.c
Signed-off-by: Al Viro
-
The handling of mount flags in set_mnt_shared() got a little tangled
up during previous cleanups, with the following problems:* MNT_PNODE_MASK is defined as a literal constant when it should be a
bitwise xor of other MNT_* flags
* set_mnt_shared() clears and then sets MNT_SHARED (part of MNT_PNODE_MASK)
* MNT_PNODE_MASK could use a comment in mount.h
* MNT_PNODE_MASK is a terrible name, change to MNT_SHARED_MASKThis patch fixes these problems.
Signed-off-by: Al Viro
-
No one is calling this anymore as everyone has switched to
invalidate_mapping_pages long time ago. Also update a few
references to it in comments. nfs has two more, but I can't
easily figure what they are actually referring to, so I left
them as-is.Signed-off-by: Christoph Hellwig
Signed-off-by: Al Viro -
re-order structure super_block to remove 16 bytes of alignment padding
on 64bit builds.This shrinks the size of super_block from 712 to 696 bytes so requiring
one fewer 64 byte cache lines.Signed-off-by: Richard Kennedy
-----
patch against 2.6.33-rc5
compiled & tested on x86_64 AMDX2 desktop machine.I've been running with this patch applied for several weeks with no
problems.regards
Richard
Signed-off-by: Al Viro -
->kill_sb() will be called after any failure exit, so no need
to duplicate what it can do.Signed-off-by: Al Viro
-
kill_litter_super() from ->kill_sb() will take care of the junk
-
... and get rid of open-coding its guts (i.e. RIP autofs4_force_release())
Signed-off-by: Al Viro
-
path to mnt/mnt->mnt_root is no worse than that to
mnt->mnt_parent/mnt->mnt_mountpoint *and* needs no
pinning the sucker down (mnt is not going away and
mnt->mnt_root won't change)Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
* document locking
* add the missing part of data structure invariants (relationship
between mnt_share and mnt_slave lists in case of a peer group
among slaves).Signed-off-by: Al Viro