aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-linus' of ↵Linus Torvalds2010-03-0473-1080/+773
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (52 commits) init: Open /dev/console from rootfs mqueue: fix typo "failues" -> "failures" mqueue: only set error codes if they are really necessary mqueue: simplify do_open() error handling mqueue: apply mathematics distributivity on mq_bytes calculation mqueue: remove unneeded info->messages initialization mqueue: fix mq_open() file descriptor leak on user-space processes fix race in d_splice_alias() set S_DEAD on unlink() and non-directory rename() victims vfs: add NOFOLLOW flag to umount(2) get rid of ->mnt_parent in tomoyo/realpath hppfs can use existing proc_mnt, no need for do_kern_mount() in there Mirror MS_KERNMOUNT in ->mnt_flags get rid of useless vfsmount_lock use in put_mnt_ns() Take vfsmount_lock to fs/internal.h get rid of insanity with namespace roots in tomoyo take check for new events in namespace (guts of mounts_poll()) to namespace.c Don't mess with generic_permission() under ->d_lock in hpfs sanitize const/signedness for udf nilfs: sanitize const/signedness in dealing with ->d_name.name ... Fix up fairly trivial (famous last words...) conflicts in drivers/infiniband/core/uverbs_main.c and security/tomoyo/realpath.c
| * Merge branch 'for-fsnotify' into for-linusAl Viro2010-03-037-76/+23
| |\
| | * switch inotify_user to anon_inodeAl Viro2010-02-192-54/+6
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| | * Lose the first argument of audit_inode_child()Al Viro2010-02-084-16/+12
| | | | | | | | | | | | | | | | | | it's always equal to ->d_name.name of the second argument Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| | * Lose the new_name argument of fsnotify_move()Al Viro2010-02-083-6/+5
| | | | | | | | | | | | | | | | | | it's always new_dentry->d_name.name Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | init: Open /dev/console from rootfsEric W. Biederman2010-03-032-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | mqueue: fix typo "failues" -> "failures"André Goddard Rosa2010-03-031-1/+1
| | | | | | | | | | | | | | | Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | mqueue: only set error codes if they are really necessaryAndré Goddard Rosa2010-03-031-27/+50
| | | | | | | | | | | | | | | | | | | | | ... 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>
| * | mqueue: simplify do_open() error handlingAndré Goddard Rosa2010-03-031-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | mqueue: apply mathematics distributivity on mq_bytes calculationAndré Goddard Rosa2010-03-031-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | mqueue: remove unneeded info->messages initializationAndré Goddard Rosa2010-03-031-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... 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>
| * | mqueue: fix mq_open() file descriptor leak on user-space processesAndré Goddard Rosa2010-03-031-2/+1
| | | | | | | | | | | | | | | | | | | | | 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>
| * | fix race in d_splice_alias()Al Viro2010-03-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | set S_DEAD on unlink() and non-directory rename() victimsAl Viro2010-03-031-1/+6
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | vfs: add NOFOLLOW flag to umount(2)Miklos Szeredi2010-03-032-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | get rid of ->mnt_parent in tomoyo/realpathAl Viro2010-03-031-1/+1
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | hppfs can use existing proc_mnt, no need for do_kern_mount() in thereAl Viro2010-03-031-1/+1
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | Mirror MS_KERNMOUNT in ->mnt_flagsAl Viro2010-03-033-1/+6
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | get rid of useless vfsmount_lock use in put_mnt_ns()Al Viro2010-03-031-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Take vfsmount_lock to fs/internal.hAl Viro2010-03-032-1/+2
| | | | | | | | | | | | | | | | | | | | | 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>
| * | get rid of insanity with namespace roots in tomoyoAl Viro2010-03-031-19/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | take check for new events in namespace (guts of mounts_poll()) to namespace.cAl Viro2010-03-033-8/+18
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | Don't mess with generic_permission() under ->d_lock in hpfsAl Viro2010-03-031-6/+9
| | | | | | | | | | | | | | | | | | Just use dentry_unhash() there Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | sanitize const/signedness for udfAl Viro2010-03-035-19/+19
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | nilfs: sanitize const/signedness in dealing with ->d_name.nameAl Viro2010-03-031-2/+2
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | nilfs really shouldn't slap struct dentry on stack...Al Viro2010-03-033-15/+12
| | | | | | | | | | | | | | | | | | ... especially when it only needs (and initializes) .d_name of it Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | sanitize const/signedness of ufs a bitAl Viro2010-03-032-7/+7
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | sanitize signedness/const for pointers to char in hpfs a bitAl Viro2010-03-0310-82/+97
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | new helper: iterate_mounts()Al Viro2010-03-033-34/+33
| | | | | | | | | | | | | | | | | | | | | 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>
| * | fix NFS4 handling of mountpoint statAl Viro2010-03-031-3/+9
| | | | | | | | | | | | | | | | | | | | | 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>
| * | Clean follow_dotdot() up a bitAl Viro2010-03-031-16/+3
| | | | | | | | | | | | | | | | | | No need to open-code follow_up() in it and locking can be lighter. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | fix mnt_mountpoint abuse in smackAl Viro2010-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | (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>
| * | a couple of mntget+dget -> path_get in nfs4procAl Viro2010-03-031-4/+4
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | Switch alloc_nfs_open_context() to struct pathAl Viro2010-03-031-4/+4
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | New helper: path_is_under(path1, path2)Al Viro2010-03-033-39/+37
| | | | | | | | | | | | | | | | | | Analog of is_subdir for vfsmount,dentry pairs, moved from audit_tree.c Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | VFS: Clean up shared mount flag propagationValerie Aurora2010-03-033-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | kill unused invalidate_inode_pages helperChristoph Hellwig2010-03-034-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | fs: re-order super_block to remove 16 bytes of padding on 64bit buildsRichard Kennedy2010-03-031-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Simplify failure exits in s390/hypfs fill_super()Al Viro2010-03-031-29/+13
| | | | | | | | | | | | | | | | | | | | | ->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>
| * | Don't bother with d_genocide in rpc_pipeAl Viro2010-03-031-7/+2
| | | | | | | | | | | | kill_litter_super() from ->kill_sb() will take care of the junk
| * | Use kill_litter_super() in autofs4 ->kill_sb()Al Viro2010-03-031-61/+1
| | | | | | | | | | | | | | | | | | ... and get rid of open-coding its guts (i.e. RIP autofs4_force_release()) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | Get rid of mnt_mountpoint abuses in ext4Al Viro2010-03-031-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Sanitize autofs_dev_ioctl_ismountpoint()Al Viro2010-03-031-7/+4
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | switch infiniband uverbs to anon_inodesAl Viro2010-03-034-81/+29
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | add several pieces to shared subtree documentationAl Viro2010-03-031-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * | Kill CL_PROPAGATION, sanitize fs/pnode.c:get_source()Al Viro2010-03-033-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Switch gfs2 to nd_set_link()Al Viro2010-03-031-86/+27
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | Switch may_open() and break_lease() to passing O_...Al Viro2010-03-038-21/+18
| | | | | | | | | | | | | | | | | | ... instead of mixing FMODE_ and O_ Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | fs: improve remount,ro vs buffercache coherencyNick Piggin2010-03-031-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | fs/dcache.c: CodingStyle cleanupH Hartley Sweeten2010-03-031-23/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>