summaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
* kill f_dentry usesAl Viro2014-11-197-10/+10
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* lockd: get rid of ->f_path.dentry->d_sbAl Viro2014-11-191-1/+1
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* procfs: get rid of ->f_dentryAl Viro2014-11-191-2/+2
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* nfsd: get rid of ->f_dentryAl Viro2014-11-191-1/+1
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* rpc_pipefs.c: get rid of f_dentryAl Viro2014-11-191-1/+1
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* afs_fsync: don't bother with ->f_path.dentryAl Viro2014-11-191-5/+4
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* cifs: get rid of ->f_path.dentry->d_sb uses, add a new helperAl Viro2014-11-194-11/+16
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* btrfs: get rid of f_dentry useAl Viro2014-11-191-1/+1
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* nfsd/nfsctl.c: new helperAl Viro2014-11-191-21/+16
| | | | | | ... to get from opened file on nfsctl to relevant struct net * Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* assorted conversions to %p[dD]Al Viro2014-11-1927-229/+168
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* switch d_materialise_unique() users to d_splice_alias()Al Viro2014-11-198-10/+10
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* merge d_materialise_unique() into d_splice_alias()Al Viro2014-11-191-108/+35
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Merge branch 'for-gfs2' into for-nextAl Viro2014-11-191-17/+9
|\
| * gfs2_atomic_open(): simplify the use of finish_no_open()Al Viro2014-11-191-5/+2
| | | | | | | | | | | | | | | | | | In ->atomic_open(inode, dentry, file, opened) calling finish_no_open(file, NULL) is equivalent to dget(dentry); return finish_no_open(file, dentry); No need to open-code that... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * gfs2_create_inode(): don't bother with d_splice_alias()Al Viro2014-11-191-14/+4
| | | | | | | | | | | | | | | | | | | | dentry is always hashed and negative, inode - non-error, non-NULL and non-directory. In such conditions d_splice_alias() is equivalent to "d_instantiate(dentry, inode) and return NULL", which simplifies the downstream code and is consistent with the "have to create a new object" case. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * gfs2: bugger off early if O_CREAT open finds a directoryAl Viro2014-11-191-0/+5
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | d_add_ci() should just accept a hashed exact match if it finds oneAl Viro2014-11-191-39/+7
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | deal with deadlock in d_walk()Al Viro2014-11-031-15/+16
| | | | | | | | | | | | | | | | | | ... by not hitting rename_retry for reasons other than rename having happened. In other words, do _not_ restart when finding that between unlocking the child and locking the parent the former got into __dentry_kill(). Skip the killed siblings instead... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | move d_rcu from overlapping d_child to overlapping d_aliasAl Viro2014-11-0316-57/+56
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | new helper: is_root_inode()Al Viro2014-10-314-15/+8
| | | | | | | | | | | | replace open-coded instances Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | vfs: make first argument of dir_context.actor typedMiklos Szeredi2014-10-3115-57/+83
| | | | | | | | | | Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | ovl: initialize ->is_cursorMiklos Szeredi2014-10-311-0/+1
| | | | | | | | | | Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | Return short read or 0 at end of a raw device, not EIODavid Jeffery2014-10-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Author: David Jeffery <djeffery@redhat.com> Changes to the basic direct I/O code have broken the raw driver when reading to the end of a raw device. Instead of returning a short read for a read that extends partially beyond the device's end or 0 when at the end of the device, these reads now return EIO. The raw driver needs the same end of device handling as was added for normal block devices. Using blkdev_read_iter, which has the needed size checks, prevents the EIO conditions at the end of the device. Signed-off-by: David Jeffery <djeffery@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | isofs: don't bother with ->d_op for normal caseAl Viro2014-10-312-22/+4
| | | | | | | | | | | | we only need it for joliet and case-insensitive mounts Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | isofs_cmp(): we'll never see a dentry for . or ..Al Viro2014-10-281-18/+2
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | overlayfs: fix lockdep misannotationMiklos Szeredi2014-10-282-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In an overlay directory that shadows an empty lower directory, say /mnt/a/empty102, do: touch /mnt/a/empty102/x unlink /mnt/a/empty102/x rmdir /mnt/a/empty102 It's actually harmless, but needs another level of nesting between I_MUTEX_CHILD and I_MUTEX_NORMAL. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Tested-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | ovl: fix check for cursorMiklos Szeredi2014-10-281-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | ovl_cache_entry.name is now an array not a pointer, so it makes no sense test for it being NULL. Detected by coverity. From: Miklos Szeredi <mszeredi@suse.cz> Fixes: 68bf8611076a ("overlayfs: make ovl_cache_entry->name an array instead of +pointer") Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | overlayfs: barriers for opening upper-layer directoryAl Viro2014-10-281-1/+2
|/ | | | | | | | | make sure that a) all stores done by opening struct file don't leak past storing the reference in od->upperfile b) the lockless side has read dependency barrier Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Merge branch 'for-linus' of ↵Linus Torvalds2014-10-2619-57/+3522
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs updates from Al Viro: "overlayfs merge + leak fix for d_splice_alias() failure exits" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: overlayfs: embed middle into overlay_readdir_data overlayfs: embed root into overlay_readdir_data overlayfs: make ovl_cache_entry->name an array instead of pointer overlayfs: don't hold ->i_mutex over opening the real directory fix inode leaks on d_splice_alias() failure exits fs: limit filesystem stacking depth overlay: overlay filesystem documentation overlayfs: implement show_options overlayfs: add statfs support overlay filesystem shmem: support RENAME_WHITEOUT ext4: support RENAME_WHITEOUT vfs: add RENAME_WHITEOUT vfs: add whiteout support vfs: export check_sticky() vfs: introduce clone_private_mount() vfs: export __inode_permission() to modules vfs: export do_splice_direct() to modules vfs: add i_op->dentry_open()
| * overlayfs: embed middle into overlay_readdir_dataAl Viro2014-10-241-7/+5
| | | | | | | | | | | | same story... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * overlayfs: embed root into overlay_readdir_dataAl Viro2014-10-241-6/+5
| | | | | | | | | | | | | | no sense having it a pointer - all instances have it pointing to local variable in the same stack frame Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * overlayfs: make ovl_cache_entry->name an array instead of pointerAl Viro2014-10-241-6/+5
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * overlayfs: don't hold ->i_mutex over opening the real directoryAl Viro2014-10-241-6/+13
| | | | | | | | | | | | just use it to serialize the assignment Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * Merge branch 'overlayfs.v25' of ↵Al Viro2014-10-2318-57/+3517
| |\ | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs into for-linus
| | * fs: limit filesystem stacking depthMiklos Szeredi2014-10-242-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a simple read-only counter to super_block that indicates how deep this is in the stack of filesystems. Previously ecryptfs was the only stackable filesystem and it explicitly disallowed multiple layers of itself. Overlayfs, however, can be stacked recursively and also may be stacked on top of ecryptfs or vice versa. To limit the kernel stack usage we must limit the depth of the filesystem stack. Initially the limit is set to 2. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
| | * overlayfs: implement show_optionsErez Zadok2014-10-241-28/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is useful because of the stacking nature of overlayfs. Users like to find out (via /proc/mounts) which lower/upper directory were used at mount time. AV: even failing ovl_parse_opt() could've done some kstrdup() AV: failure of ovl_alloc_entry() should end up with ENOMEM, not EINVAL Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
| | * overlayfs: add statfs supportAndy Whitcroft2014-10-241-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for statfs to the overlayfs filesystem. As the upper layer is the target of all write operations assume that the space in that filesystem is the space in the overlayfs. There will be some inaccuracy as overwriting a file will copy it up and consume space we were not expecting, but it is better than nothing. Use the upper layer dentry and mount from the overlayfs root inode, passing the statfs call to that filesystem. Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
| | * overlay filesystemMiklos Szeredi2014-10-2410-0/+3284
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Overlayfs allows one, usually read-write, directory tree to be overlaid onto another, read-only directory tree. All modifications go to the upper, writable layer. This type of mechanism is most often used for live CDs but there's a wide variety of other uses. The implementation differs from other "union filesystem" implementations in that after a file is opened all operations go directly to the underlying, lower or upper, filesystems. This simplifies the implementation and allows native performance in these cases. The dentry tree is duplicated from the underlying filesystems, this enables fast cached lookups without adding special support into the VFS. This uses slightly more memory than union mounts, but dentries are relatively small. Currently inodes are duplicated as well, but it is a possible optimization to share inodes for non-directories. Opening non directories results in the open forwarded to the underlying filesystem. This makes the behavior very similar to union mounts (with the same limitations vs. fchmod/fchown on O_RDONLY file descriptors). Usage: mount -t overlayfs overlayfs -olowerdir=/lower,upperdir=/upper/upper,workdir=/upper/work /overlay The following cotributions have been folded into this patch: Neil Brown <neilb@suse.de>: - minimal remount support - use correct seek function for directories - initialise is_real before use - rename ovl_fill_cache to ovl_dir_read Felix Fietkau <nbd@openwrt.org>: - fix a deadlock in ovl_dir_read_merged - fix a deadlock in ovl_remove_whiteouts Erez Zadok <ezk@fsl.cs.sunysb.edu> - fix cleanup after WARN_ON Sedat Dilek <sedat.dilek@googlemail.com> - fix up permission to confirm to new API Robin Dong <hao.bigrat@gmail.com> - fix possible leak in ovl_new_inode - create new inode in ovl_link Andy Whitcroft <apw@canonical.com> - switch to __inode_permission() - copy up i_uid/i_gid from the underlying inode AV: - ovl_copy_up_locked() - dput(ERR_PTR(...)) on two failure exits - ovl_clear_empty() - one failure exit forgetting to do unlock_rename(), lack of check for udir being the parent of upper, dropping and regaining the lock on udir (which would require _another_ check for parent being right). - bogus d_drop() in copyup and rename [fix from your mail] - copyup/remove and copyup/rename races [fix from your mail] - ovl_dir_fsync() leaving ERR_PTR() in ->realfile - ovl_entry_free() is pointless - it's just a kfree_rcu() - fold ovl_do_lookup() into ovl_lookup() - manually assigning ->d_op is wrong. Just use ->s_d_op. [patches picked from Miklos]: * copyup/remove and copyup/rename races * bogus d_drop() in copyup and rename Also thanks to the following people for testing and reporting bugs: Jordi Pujol <jordipujolp@gmail.com> Andy Whitcroft <apw@canonical.com> Michal Suchanek <hramrach@centrum.cz> Felix Fietkau <nbd@openwrt.org> Erez Zadok <ezk@fsl.cs.sunysb.edu> Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
| | * ext4: support RENAME_WHITEOUTMiklos Szeredi2014-10-241-17/+78
| | | | | | | | | | | | | | | | | | | | | | | | Add whiteout support to ext4_rename(). A whiteout inode (chrdev/0,0) is created before the rename takes place. The whiteout inode is added to the old entry instead of deleting it. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
| | * vfs: add RENAME_WHITEOUTMiklos Szeredi2014-10-241-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | This adds a new RENAME_WHITEOUT flag. This flag makes rename() create a whiteout of source. The whiteout creation is atomic relative to the rename. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
| | * vfs: add whiteout supportMiklos Szeredi2014-10-241-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whiteout isn't actually a new file type, but is represented as a char device (Linus's idea) with 0/0 device number. This has several advantages compared to introducing a new whiteout file type: - no userspace API changes (e.g. trivial to make backups of upper layer filesystem, without losing whiteouts) - no fs image format changes (you can boot an old kernel/fsck without whiteout support and things won't break) - implementation is trivial Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
| | * vfs: export check_sticky()Miklos Szeredi2014-10-242-26/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | It's already duplicated in btrfs and about to be used in overlayfs too. Move the sticky bit check to an inline helper and call the out-of-line helper only in the unlikly case of the sticky bit being set. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
| | * vfs: introduce clone_private_mount()Miklos Szeredi2014-10-241-0/+27
| | | | | | | | | | | | | | | | | | | | | Overlayfs needs a private clone of the mount, so create a function for this and export to modules. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
| | * vfs: export __inode_permission() to modulesMiklos Szeredi2014-10-242-1/+1
| | | | | | | | | | | | | | | | | | | | | We need to be able to check inode permissions (but not filesystem implied permissions) for stackable filesystems. Expose this interface for overlayfs. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
| | * vfs: export do_splice_direct() to modulesMiklos Szeredi2014-10-242-6/+1
| | | | | | | | | | | | | | | | | | Export do_splice_direct() to modules. Needed by overlay filesystem. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
| | * vfs: add i_op->dentry_open()Miklos Szeredi2014-10-242-5/+27
| | | | | | | | | | | | | | | | | | | | | Add a new inode operation i_op->dentry_open(). This is for stacked filesystems that want to return a struct file from a different filesystem. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
| * | fix inode leaks on d_splice_alias() failure exitsAl Viro2014-10-231-0/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | d_splice_alias() callers expect it to either stash the inode reference into a new alias, or drop the inode reference. That makes it possible to just return d_splice_alias() result from ->lookup() instance, without any extra housekeeping required. Unfortunately, that should include the failure exits. If d_splice_alias() returns an error, it leaves the dentry it has been given negative and thus it *must* drop the inode reference. Easily fixed, but it goes way back and will need backporting. Cc: stable@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osdLinus Torvalds2014-10-2117-18/+18
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Pull email address change from Boaz Harrosh. * 'for-linus' of git://git.open-osd.org/linux-open-osd: Boaz Harrosh - fix email in Documentation Boaz Harrosh - Fix broken email address MAINTAINERS: Change Boaz Harrosh's email
| * | Boaz Harrosh - Fix broken email addressBoaz Harrosh2014-10-1917-18/+18
| | | | | | | | | | | | | | | | | | | | | I no longer have access to the Panasas email. So change to an email that can always reach me. Signed-off-by: Boaz Harrosh <ooo@electrozaur.com>
* | | Merge tag 'ext4_for_linus' of ↵Linus Torvalds2014-10-2028-1869/+1336
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 updates from Ted Ts'o: "A large number of cleanups and bug fixes, with some (minor) journal optimizations" [ This got sent to me before -rc1, but was stuck in my spam folder. - Linus ] * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (67 commits) ext4: check s_chksum_driver when looking for bg csum presence ext4: move error report out of atomic context in ext4_init_block_bitmap() ext4: Replace open coded mdata csum feature to helper function ext4: delete useless comments about ext4_move_extents ext4: fix reservation overflow in ext4_da_write_begin ext4: add ext4_iget_normal() which is to be used for dir tree lookups ext4: don't orphan or truncate the boot loader inode ext4: grab missed write_count for EXT4_IOC_SWAP_BOOT ext4: optimize block allocation on grow indepth ext4: get rid of code duplication ext4: fix over-defensive complaint after journal abort ext4: fix return value of ext4_do_update_inode ext4: fix mmap data corruption when blocksize < pagesize vfs: fix data corruption when blocksize < pagesize for mmaped data ext4: fold ext4_nojournal_sops into ext4_sops ext4: support freezing ext2 (nojournal) file systems ext4: fold ext4_sync_fs_nojournal() into ext4_sync_fs() ext4: don't check quota format when there are no quota files jbd2: simplify calling convention around __jbd2_journal_clean_checkpoint_list jbd2: avoid pointless scanning of checkpoint lists ...
OpenPOWER on IntegriCloud