summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2010-03-03init: Open /dev/console from rootfsEric W. Biederman
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 <ebiederm@xmission.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03mqueue: fix typo "failues" -> "failures"André Goddard Rosa
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03mqueue: only set error codes if they are really necessaryAndré Goddard Rosa
... postponing assignments until they're needed. Doesn't change code size. Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03mqueue: simplify do_open() error handlingAndré Goddard Rosa
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.o Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03mqueue: apply mathematics distributivity on mq_bytes calculationAndré Goddard Rosa
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.o Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03mqueue: remove unneeded info->messages initializationAndré Goddard Rosa
... 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.o Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03mqueue: fix mq_open() file descriptor leak on user-space processesAndré Goddard Rosa
We leak fd on lookup_one_len() failure Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03fix race in d_splice_alias()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 <viro@zeniv.linux.org.uk>
2010-03-03set S_DEAD on unlink() and non-directory rename() victimsAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03vfs: add NOFOLLOW flag to umount(2)Miklos Szeredi
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 <eugene@redhat.com> CC: Michael Kerrisk <mtk.manpages@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03get rid of ->mnt_parent in tomoyo/realpathAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03hppfs can use existing proc_mnt, no need for do_kern_mount() in thereAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03Mirror MS_KERNMOUNT in ->mnt_flagsAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03get rid of useless vfsmount_lock use in put_mnt_ns()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 <viro@zeniv.linux.org.uk>
2010-03-03Take vfsmount_lock to fs/internal.hAl Viro
no more users left outside of fs/*.c (and very few outside of fs/namespace.c, actually) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03get rid of insanity with namespace roots in tomoyoAl 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 <viro@zeniv.linux.org.uk>
2010-03-03take check for new events in namespace (guts of mounts_poll()) to namespace.cAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03Don't mess with generic_permission() under ->d_lock in hpfsAl Viro
Just use dentry_unhash() there Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03sanitize const/signedness for udfAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03nilfs: sanitize const/signedness in dealing with ->d_name.nameAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03nilfs really shouldn't slap struct dentry on stack...Al Viro
... especially when it only needs (and initializes) .d_name of it Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03sanitize const/signedness of ufs a bitAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03sanitize signedness/const for pointers to char in hpfs a bitAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03new helper: iterate_mounts()Al Viro
apply function to vfsmounts in set returned by collect_mounts(), stop if it returns non-zero. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03fix NFS4 handling of mountpoint statAl 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 <viro@zeniv.linux.org.uk>
2010-03-03Clean follow_dotdot() up a bitAl Viro
No need to open-code follow_up() in it and locking can be lighter. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03fix mnt_mountpoint abuse in smackAl 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 <viro@zeniv.linux.org.uk>
2010-03-03a couple of mntget+dget -> path_get in nfs4procAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03Switch alloc_nfs_open_context() to struct pathAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03New helper: path_is_under(path1, path2)Al Viro
Analog of is_subdir for vfsmount,dentry pairs, moved from audit_tree.c Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03VFS: Clean up shared mount flag propagationValerie Aurora
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_MASK This patch fixes these problems. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03kill unused invalidate_inode_pages helperChristoph Hellwig
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 <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03fs: re-order super_block to remove 16 bytes of padding on 64bit buildsRichard Kennedy
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 <richard@rsk.demon.co.uk> ----- 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 <viro@zeniv.linux.org.uk>
2010-03-03Simplify failure exits in s390/hypfs fill_super()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 <viro@zeniv.linux.org.uk>
2010-03-03Don't bother with d_genocide in rpc_pipeAl Viro
kill_litter_super() from ->kill_sb() will take care of the junk
2010-03-03Use kill_litter_super() in autofs4 ->kill_sb()Al Viro
... and get rid of open-coding its guts (i.e. RIP autofs4_force_release()) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03Get rid of mnt_mountpoint abuses in ext4Al 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 <viro@zeniv.linux.org.uk>
2010-03-03Sanitize autofs_dev_ioctl_ismountpoint()Al Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03switch infiniband uverbs to anon_inodesAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03add several pieces to shared subtree documentationAl 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 <viro@zeniv.linux.org.uk>
2010-03-03Kill CL_PROPAGATION, sanitize fs/pnode.c:get_source()Al Viro
First of all, get_source() never results in CL_PROPAGATION alone. We either get CL_MAKE_SHARED (for the continuation of peer group) or CL_SLAVE (slave that is not shared) or both (beginning of peer group among slaves). Massage the code to make that explicit, kill CL_PROPAGATION test in clone_mnt() (nothing sets CL_MAKE_SHARED without CL_PROPAGATION and in clone_mnt() we are checking CL_PROPAGATION after we'd found that there's no CL_SLAVE, so the check for CL_MAKE_SHARED would do just as well). Fix comments, while we are at it... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03Switch gfs2 to nd_set_link()Al Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03Switch may_open() and break_lease() to passing O_...Al Viro
... instead of mixing FMODE_ and O_ Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03fs: improve remount,ro vs buffercache coherencyNick Piggin
Invalidate sb->s_bdev on remount,ro. Fixes a problem reported by Jorge Boncompte who is seeing corruption trying to snapshot a minix filesystem image. Some filesystems modify their metadata via a path other than the bdev buffer cache (eg. they may use a private linear mapping for their metadata, or implement directories in pagecache, etc). Also, file data modifications usually go to the bdev via their own mappings. These updates are not coherent with buffercache IO (eg. via /dev/bdev) and never have been. However there could be a reasonable expectation that after a mount -oremount,ro operation then the buffercache should subsequently be coherent with previous filesystem modifications. So invalidate the bdev mappings on a remount,ro operation to provide a coherency point. The problem was exposed when we switched the old rd to brd because old rd didn't really function like a normal block device and updates to rd via mappings other than the buffercache would still end up going into its buffercache. But the same problem has always affected other "normal" block devices, including loop. [akpm@linux-foundation.org: repair comment layout] Reported-by: "Jorge Boncompte [DTI2]" <jorge@dti2.net> Tested-by: "Jorge Boncompte [DTI2]" <jorge@dti2.net> Signed-off-by: Nick Piggin <npiggin@suse.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03fs/dcache.c: CodingStyle cleanupH Hartley Sweeten
Cleanup EXPORT* macros according to Documantation/CodingStyle. Move EXPORT* macros to the line immediately after the closing function brace. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03some clean up in fs/procHelight.Xu
EXPORT_SYMBOL(proc_symlink); EXPORT_SYMBOL(proc_mkdir); EXPORT_SYMBOL(create_proc_entry); EXPORT_SYMBOL(proc_create_data); EXPORT_SYMBOL(remove_proc_entry); Those EXPORT_SYMBOL shouldn't be in fs/proc/root.c, should be in fs/proc/generic.c. Signed-off-by: Helight.Xu <helight.xu@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03libfs: Unexport and kill simple_prepare_writeBoaz Harrosh
Remove the EXPORT_UNUSED_SYMBOL of simple_prepare_write Collapse simple_prepare_write into it's only caller, though making it simpler and clearer to understand. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03libfs: Open code simple_commit_write into only userBoaz Harrosh
* simple_commit_write was only called by simple_write_end. Open coding it makes it tiny bit less heavy on the arithmetic and much more readable. * While at it use zero_user() for clearing a partial page. * While at it add a docbook comment for simple_write_end. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-03-03Revert "autofs4: always use lookup for lookup"Al Viro
This reverts commit 213614d583748d00967a91cacd656f417efb36ce. Alas, ->d_revalidate() can't rely on ->lookup() finishing what it's started; if d_alloc() in do_lookup() fails, we are not going to call ->lookup() at all. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-02-24Linux 2.6.33Linus Torvalds