aboutsummaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAge
* Merge branch 'for-linus' of ↵Linus Torvalds2010-03-04
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-03
| |\
| | * switch inotify_user to anon_inodeAl Viro2010-02-19
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| | * Lose the first argument of audit_inode_child()Al Viro2010-02-08
| | | | | | | | | | | | | | | | | | 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-08
| | | | | | | | | | | | | | | | | | it's always new_dentry->d_name.name Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | fix race in d_splice_alias()Al Viro2010-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-03
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | vfs: add NOFOLLOW flag to umount(2)Miklos Szeredi2010-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | hppfs can use existing proc_mnt, no need for do_kern_mount() in thereAl Viro2010-03-03
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | Mirror MS_KERNMOUNT in ->mnt_flagsAl Viro2010-03-03
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | get rid of useless vfsmount_lock use in put_mnt_ns()Al Viro2010-03-03
| | | | | | | | | | | | | | | | | | | | | | | | 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-03
| | | | | | | | | | | | | | | | | | | | | 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>
| * | take check for new events in namespace (guts of mounts_poll()) to namespace.cAl Viro2010-03-03
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | Don't mess with generic_permission() under ->d_lock in hpfsAl Viro2010-03-03
| | | | | | | | | | | | | | | | | | Just use dentry_unhash() there Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | sanitize const/signedness for udfAl Viro2010-03-03
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | nilfs: sanitize const/signedness in dealing with ->d_name.nameAl Viro2010-03-03
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | nilfs really shouldn't slap struct dentry on stack...Al Viro2010-03-03
| | | | | | | | | | | | | | | | | | ... 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-03
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | sanitize signedness/const for pointers to char in hpfs a bitAl Viro2010-03-03
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | new helper: iterate_mounts()Al Viro2010-03-03
| | | | | | | | | | | | | | | | | | | | | 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-03
| | | | | | | | | | | | | | | | | | | | | 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-03
| | | | | | | | | | | | | | | | | | No need to open-code follow_up() in it and locking can be lighter. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | a couple of mntget+dget -> path_get in nfs4procAl Viro2010-03-03
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | Switch alloc_nfs_open_context() to struct pathAl Viro2010-03-03
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | New helper: path_is_under(path1, path2)Al Viro2010-03-03
| | | | | | | | | | | | | | | | | | 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-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Use kill_litter_super() in autofs4 ->kill_sb()Al Viro2010-03-03
| | | | | | | | | | | | | | | | | | ... 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-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-03
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | Kill CL_PROPAGATION, sanitize fs/pnode.c:get_source()Al Viro2010-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-03
| | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * | Switch may_open() and break_lease() to passing O_...Al Viro2010-03-03
| | | | | | | | | | | | | | | | | | ... 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-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | some clean up in fs/procHelight.Xu2010-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | libfs: Unexport and kill simple_prepare_writeBoaz Harrosh2010-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | libfs: Open code simple_commit_write into only userBoaz Harrosh2010-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * | Revert "autofs4: always use lookup for lookup"Al Viro2010-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge branch 'for-linus' of ↵Linus Torvalds2010-03-03
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2: nilfs2: add reader's lock for cno in nilfs_ioctl_sync nilfs2: delete unnecessary condition in load_segment_summary nilfs2: move iterator to write log into segment buffer nilfs2: get rid of s_dirt flag use nilfs2: get rid of nilfs_segctor_req struct nilfs2: delete unnecessary condition in nilfs_dat_translate nilfs2: fix potential hang in nilfs_error on errors=remount-ro nilfs2: use mnt_want_write in ioctls where write access is needed nilfs2: issue discard request after cleaning segments
| * | | nilfs2: add reader's lock for cno in nilfs_ioctl_syncJiro SEKIBA2010-02-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds reader's lock for the_nilfs->cno in nilfs_ioctl_sync, for the_nilfs->cno should be proctected by segctor_sem when reading. Signed-off-by: Jiro SEKIBA <jir@unicus.jp> Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
| * | | nilfs2: delete unnecessary condition in load_segment_summaryJiro SEKIBA2010-02-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a trivial patch to remove unnecessary condition. load_segment_summary() checks crc of segment_summary OR crc of whole log data blocks based on boolean argument full_check. However, callers of the function pass only 1 as full_check, which means only whole log data blocks checking code is running all the time. This patch deletes the condition and full_check argument and also deletes enum 'NILFS_SEG_FAIL_CHECKSUM_SEGSUM' and corresponding case clause, for it is nolonger used anymore. Signed-off-by: Jiro SEKIBA <jir@unicus.jp> Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
| * | | nilfs2: move iterator to write log into segment bufferRyusuke Konishi2010-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves iterator to submit write requests for a series of logs into segbuf.c, and hides nilfs_segbuf_write() and nilfs_segbuf_wait() in the file. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
| * | | nilfs2: get rid of s_dirt flag useRyusuke Konishi2010-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces s_dirt flag use in nilfs with a new flag added on the nilfs object. The s_dirt flag was used to indicate if sop->write_super() should be called, however the current version of nilfs does not use the callback. Thus, it can be replaced with the own flag. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Cc: Jiro SEKIBA <jir@unicus.jp>
| * | | nilfs2: get rid of nilfs_segctor_req structRyusuke Konishi2010-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This will clean up nilfs_segctor_req struct and the obscure request argument passed among private methods of segment constructor. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
| * | | nilfs2: delete unnecessary condition in nilfs_dat_translateJiro SEKIBA2010-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a trivial patch to delete unnecessary condition in nilfs_dat_translate. nilfs_dat_translate() will asign translated address to *blocknrp if blocknrp is not NULL. However the condition is unneeded, because all callers of nilfs_dat_translate() pass blocknrp properly. Signed-off-by: Jiro SEKIBA <jir@unicus.jp> Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
| * | | nilfs2: fix potential hang in nilfs_error on errors=remount-roRyusuke Konishi2010-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nilfs_error() calls nilfs_detach_segment_constructor() if errors=remount-ro option is specified, and this may lead to a hang due to recursive locking of, for instance, nilfs->ns_segctor_sem and others. In this case, detaching segment constructor is not necessary because read-only flag is set to the filesystem and further writes are blocked. This fixes the potential hang issue by removing the nilfs_detach_segment_constructor() call from nilfs_error. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
| * | | nilfs2: use mnt_want_write in ioctls where write access is neededRyusuke Konishi2010-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few nilfs2 ioctls need to ask for and then later release write access to the mount in order to avoid potential write to read-only mounts. This adds the missing mnt_want_write and mnt_drop_write in nilfs_ioctl_change_cpmode, nilfs_ioctl_delete_checkpoint, and nilfs_ioctl_clean_segments. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
| * | | nilfs2: issue discard request after cleaning segmentsJiro SEKIBA2010-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a function to send discard requests for given array of segment numbers, and calls the function when garbage collection succeeded. Signed-off-by: Jiro SEKIBA <jir@unicus.jp> Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
* | | | Merge branch 'upstream-linus' of ↵Linus Torvalds2010-03-03
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2 * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2: (36 commits) Ocfs2: Move ocfs2 ioctl definitions from ocfs2_fs.h to newly added ocfs2_ioctl.h ocfs2: send SIGXFSZ if new filesize exceeds limit -v2 ocfs2/userdlm: Add tracing in userdlm ocfs2: Use a separate masklog for AST and BASTs dlm: allow dlm do recovery during shutdown ocfs2: Only bug out in direct io write for reflinked extent. ocfs2: fix warning in ocfs2_file_aio_write() ocfs2_dlmfs: Enable the use of user cluster stacks. ocfs2_dlmfs: Use the stackglue. ocfs2_dlmfs: Don't honor truncate. The size of a dlmfs file is LVB_LEN ocfs2: Pass the locking protocol into ocfs2_cluster_connect(). ocfs2: Remove the ast pointers from ocfs2_stack_plugins ocfs2: Hang the locking proto on the cluster conn and use it in asts. ocfs2: Attach the connection to the lksb ocfs2: Pass lksbs back from stackglue ast/bast functions. ocfs2_dlmfs: Move to its own directory ocfs2_dlmfs: Use poll() to signify BASTs. ocfs2_dlmfs: Add capabilities parameter. ocfs2: Handle errors while setting external xattr values. ocfs2: Set inline xattr entries with ocfs2_xa_set() ...
| * | | | Ocfs2: Move ocfs2 ioctl definitions from ocfs2_fs.h to newly added ocfs2_ioctl.hTristan Ye2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we were adding ioctl cmds/structures for ocfs2 into ocfs2_fs.h which was used for define ocfs2 on-disk layout. That sounds a little bit confusing, and it may be quickly polluted espcially when growing the ocfs2_info_request ioctls afterwards(it will grow i bet). As a result, such OCFS2 IOCs do need to be placed somewhere other than ocfs2_fs.h, a separated ocfs2_ioctl.h will be added to store such ioctl structures and definitions which could also be used from userspace to invoke ioctls call. Signed-off-by: Tristan Ye <tristan.ye@oracle.com> Signed-off-by: Joel Becker <joel.becker@oracle.com>