summaryrefslogtreecommitdiffstats
path: root/fs/orangefs/file.c
Commit message (Collapse)AuthorAgeFilesLines
* orangefs: don't call filemap_write_and_wait from fsyncJeff Layton2017-09-141-4/+1Star
| | | | | | | | Orangefs doesn't do buffered writes yet, so there's no point in initiating and waiting for writeback. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Merge tag 'for-linus-4.12-ofs-1' of ↵Linus Torvalds2017-05-051-2/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux Pull orangefs updates from Mike Marshall: "Orangefs cleanups, fixes and statx support. Some cleanups: - remove unused get_fsid_from_ino - fix bounds check for listxattr - clean up oversize xattr validation - do not set getattr_time on orangefs_lookup - return from orangefs_devreq_read quickly if possible - do not wait for timeout if umounting - handle zero size write in debugfs Bug fixes: - do not check possibly stale size on truncate - ensure the userspace component is unmounted if mount fails - total reimplementation of dir.c New feature: - implement statx The new implementation of dir.c is kind of a big deal, all new code. It has been posted to fs-devel during the previous rc period, we didn't get much review or feedback from there, but it has been reviewed very heavily here, so much so that we have two entire versions of the reimplementation. Not only does the new implementation fix some xfstests, but it passes all the new tests we made here that involve seeking and rewinding and giant directories and long file names. The new dir code has three patches itself: - skip forward to the next directory entry if seek is short - invalidate stored directory on seek - count directory pieces correctly" * tag 'for-linus-4.12-ofs-1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux: orangefs: count directory pieces correctly orangefs: invalidate stored directory on seek orangefs: skip forward to the next directory entry if seek is short orangefs: handle zero size write in debugfs orangefs: do not wait for timeout if umounting orangefs: return from orangefs_devreq_read quickly if possible orangefs: ensure the userspace component is unmounted if mount fails orangefs: do not check possibly stale size on truncate orangefs: implement statx orangefs: remove ORANGEFS_READDIR macros orangefs: support very large directories orangefs: support llseek on directories orangefs: rewrite readdir to fix several bugs orangefs: do not set getattr_time on orangefs_lookup orangefs: clean up oversize xattr validation orangefs: fix bounds check for listxattr orangefs: remove unused get_fsid_from_ino
| * orangefs: implement statxMartin Brandenburg2017-04-261-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fortunately OrangeFS has had a getattr request mask for a long time. The server basically has two difficulty levels for attributes. Fetching any attribute except size requires communicating with the metadata server for that handle. Since all the attributes are right there, it makes sense to return them all. Fetching the size requires communicating with every I/O server (that the file is distributed across). Therefore if asked for anything except size, get everything except size, and if asked for size, get everything. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* | orangefs: use iov_iter_revert()Al Viro2017-04-211-2/+1Star
|/ | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* don't open-code file_inode()Al Viro2016-12-051-1/+1
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* orangefs: user file_inode() where it is dueAmir Goldstein2016-10-241-7/+7
| | | | | | | | | | | | Replace wrong use of file->f_path.dentry->d_inode with file_inode(file). In case orangefs ever finds itself as an overelayfs layer, it would want to get its own inode and not overlayfs's inode. DISCLAIMER: I did not test this patch because I do not know how to setup an orangefs mount Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Merge branch 'for-linus' of ↵Linus Torvalds2016-10-111-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull more vfs updates from Al Viro: ">rename2() work from Miklos + current_time() from Deepa" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fs: Replace current_fs_time() with current_time() fs: Replace CURRENT_TIME_SEC with current_time() for inode timestamps fs: Replace CURRENT_TIME with current_time() for inode timestamps fs: proc: Delete inode time initializations in proc_alloc_inode() vfs: Add current_time() api vfs: add note about i_op->rename changes to porting fs: rename "rename2" i_op to "rename" vfs: remove unused i_op->rename fs: make remaining filesystems use .rename2 libfs: support RENAME_NOREPLACE in simple_rename() fs: support RENAME_NOREPLACE for local filesystems ncpfs: fix unused variable warning
| * fs: Replace CURRENT_TIME with current_time() for inode timestampsDeepa Dinamani2016-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CURRENT_TIME macro is not appropriate for filesystems as it doesn't use the right granularity for filesystem timestamps. Use current_time() instead. CURRENT_TIME is also not y2038 safe. This is also in preparation for the patch that transitions vfs timestamps to use 64 bit time and hence make them y2038 safe. As part of the effort current_time() will be extended to do range checks. Hence, it is necessary for all file system timestamps to use current_time(). Also, current_time() will be transitioned along with vfs to be y2038 safe. Note that whenever a single call to current_time() is used to change timestamps in different inodes, it is because they share the same time granularity. Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Felipe Balbi <balbi@kernel.org> Acked-by: Steven Whitehouse <swhiteho@redhat.com> Acked-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Acked-by: David Sterba <dsterba@suse.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | Merge branch 'work.misc' of ↵Linus Torvalds2016-10-101-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull misc vfs updates from Al Viro: "Assorted misc bits and pieces. There are several single-topic branches left after this (rename2 series from Miklos, current_time series from Deepa Dinamani, xattr series from Andreas, uaccess stuff from from me) and I'd prefer to send those separately" * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (39 commits) proc: switch auxv to use of __mem_open() hpfs: support FIEMAP cifs: get rid of unused arguments of CIFSSMBWrite() posix_acl: uapi header split posix_acl: xattr representation cleanups fs/aio.c: eliminate redundant loads in put_aio_ring_file fs/internal.h: add const to ns_dentry_operations declaration compat: remove compat_printk() fs/buffer.c: make __getblk_slow() static proc: unsigned file descriptors fs/file: more unsigned file descriptors fs: compat: remove redundant check of nr_segs cachefiles: Fix attempt to read i_blocks after deleting file [ver #2] cifs: don't use memcpy() to copy struct iov_iter get rid of separate multipage fault-in primitives fs: Avoid premature clearing of capabilities fs: Give dentry to inode_change_ok() instead of inode fuse: Propagate dentry down to inode_change_ok() ceph: Propagate dentry down to inode_change_ok() xfs: Propagate dentry down to inode_change_ok() ...
| * | orangefs: use %pd/%pDAl Viro2016-08-081-2/+2
| |/ | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | Merge branch 'misc' into for-nextMartin Brandenburg2016-09-281-3/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull in an OrangeFS branch containing miscellaneous improvements. - clean up debugfs globals - remove dead code in sysfs - reorganize duplicated sysfs attribute structs - consolidate sysfs show and store functions - remove duplicated sysfs_ops structures - describe organization of sysfs - make devreq_mutex static - g_orangefs_stats -> orangefs_stats for consistency - rename most remaining global variables
| * | orangefs: g_orangefs_stats -> orangefs_stats for consistencyMartin Brandenburg2016-08-151-3/+3
| | | | | | | | | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com>
* | | orangefs: do not allow client readahead cache without feature bitMartin Brandenburg2016-08-121-5/+8
|/ / | | | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com>
* | orangefs: re-add flush_racache from out-of-treeMartin Brandenburg2016-08-081-1/+33
| | | | | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com>
* | orangefs: rename remaining bits of mmap readahead cacheMartin Brandenburg2016-08-081-1/+1
|/ | | | | | | | | | This has been dormant code for many years. Parts of it were removed from the OrangeFS kernel code when it went into mainline. These bits were missed. Now the readahead cache has been resurrected in the OrangeFS userspace portions. It was renamed there, since it doesn't really have anything to do with mmap specifically, so it will be renamed here. Signed-off-by: Martin Brandenburg <martin@omnibond.com>
* orangefs: Remove useless xattr prefix argumentsAndreas Gruenbacher2016-07-051-2/+0Star
| | | | | | | | | | | | | | | | Mike, On Fri, Jun 3, 2016 at 9:44 PM, Mike Marshall <hubcap@omnibond.com> wrote: > We use the return value in this one line you changed, our userspace code gets > ill when we send it (-ENOMEM +1) as a key length... ah, my mistake. Here's a fixed version. Thanks, Andreas Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: Remove useless definesAndreas Gruenbacher2016-07-051-2/+2
| | | | | | | | The ORANGEFS_XATTR_INDEX_ defines are unused; the ORANGEFS_XATTR_NAME_ defines only obfuscate the code. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: don't open-code inode_lock/inode_unlockAl Viro2016-05-031-2/+2
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* orangefs: fix do_readv_writev() handling of error halfway throughAl Viro2016-03-261-1/+1
| | | | | | | | Error should only be returned if nothing had been read/written. Otherwise we need to report a short read/write instead. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: sanitize ->llseek()Al Viro2016-03-261-9/+3Star
| | | | | | | | | a) open files can't have NULL inodes b) it's SEEK_END, not ORANGEFS_SEEK_END; no need to get cute. c) make_bad_inode() on lseek()? Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: saner calling conventions for getting a slotAl Viro2016-03-261-5/+5
| | | | | | | | just have it return the slot number or -E... - the caller checks the sign anyway Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs_copy_{to,from}_bufmap(): don't pass bufmap pointerAl Viro2016-03-261-12/+6Star
| | | | | | | it's always __orangefs_bufmap Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: use new orangefs_inode_getattr to get size in write and llseekMartin Brandenburg2016-03-231-6/+8
| | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: rename orangefs_inode_getattr to orangefs_inode_old_getattrMartin Brandenburg2016-03-231-3/+4
| | | | | | | | This is motivated by orangefs_inode_old_getattr's habit of writing over live inodes. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: improve the POSIXness of interrupted writes...Mike Marshall2016-03-091-9/+45
| | | | | | | Don't return EINTR on interrupted writes if some data has already been written. Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: improve gossip statementsMike Marshall2016-03-031-6/+2Star
| | | | Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: remove vestigial async io codeMartin Brandenburg2016-02-241-1/+0Star
| | | | | | | | I have verified that there is nothing in the userspace daemon version we are implementing this protocol against that ever looks at this field. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: get rid of op->doneAl Viro2016-02-191-4/+2Star
| | | | | | | shouldn't be needed now Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: delay freeing slot until cancel completesAl Viro2016-02-191-12/+4Star
| | | | | | | | | | | | | | | Make cancels reuse the aborted read/write op, to make sure they do not fail on lack of memory. Don't issue a cancel unless the daemon has seen our read/write, has not replied and isn't being shut down. If cancel *is* issued, don't wait for it to complete; stash the slot in there and just have it freed when cancel is finally replied to or purged (and delay dropping the reference until then, obviously). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* get rid of bufmap argument of orangefs_bufmap_put()Al Viro2016-02-121-3/+3
| | | | | | | | it's always equal to __orangefs_bufmap and the latter can't change until we are done Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: get rid of handle_io_error()Al Viro2016-02-121-51/+14Star
| | | | | | | the second caller never needs to cancel, actually Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: wait_for_direct_io(): restore the position in iter when restartingAl Viro2016-02-121-0/+3
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: avoid freeing a slot twice in wait_for_direct_io()Al Viro2016-02-121-0/+1
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: added a couple of WARN_ONs, perhaps just temporarily.Mike Marshall2016-02-041-0/+1
| | | | Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: Fix revalidate.Martin Brandenburg2016-01-281-2/+2
| | | | | | | | | | | | | | | | Previously, it would update a live inode. This was fixed, but it did not ever check that the inode attributes in the dcache are correct. This checks all inode attributes and rejects any that are not correct, which causes a lookup and thus a new getattr. Perhaps inode_operations->permission should replace or augment some of this. There is no actual caching, and this does a rather excessive amount of network operations back to the filesystem server. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: move handle_io_error() to file.cAl Viro2016-01-231-6/+41
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: don't reinvent completion.h...Al Viro2016-01-231-4/+1Star
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: hopefully saner op refcounting and lockingAl Viro2016-01-231-12/+5Star
| | | | | | | | | | | | | | | | | | * create with refcount 1 * make op_release() decrement and free if zero (i.e. old put_op() has become that). * mark when submitter has given up waiting; from that point nobody else can move between the lists, change state, etc. * have daemon read/write_iter grab a reference when picking op and *always* give it up in the end * don't put into hash until we know it's been successfully passed to daemon * move op->lock _lower_ than htab_in_progress_lock (and make sure to take it in purge_inprogress_ops()) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: change pvfs2 filenames to orangefsMike Marshall2015-12-041-3/+3
| | | | | | | Also changed references within source files that referred to header files whose names had changed. Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* OrangeFS: Change almost all instances of the string PVFS2 to OrangeFS.Yi Liu2015-12-031-104/+104
| | | | | | | | | | | | | | | | | | | | | | OrangeFS was formerly known as PVFS2 and retains the name in many places. I leave the device /dev/pvfs2-req since this affects userspace. I leave the filesystem type pvfs2 since this affects userspace. Further the OrangeFS sysint library reads fstab for an entry of type pvfs2 independently of kernel mounts. I leave extended attribute keys user.pvfs2 and system.pvfs2 as the sysint library understands these. I leave references to userspace binaries still named pvfs2. I leave the filenames. Signed-off-by: Yi Liu <yi9@clemson.edu> [martin@omnibond.com: clairify above constraints and merge] Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* fs: out of bounds on stack in iov_iter_advanceAl Viro2015-11-161-11/+8Star
| | | | | | | | | | | | | On Wed, Nov 11, 2015 at 10:19:48AM +0000, Al Viro wrote: > I'll cook the minimal fixup for API change after I get some sleep and > send it your way, unless somebody gets there first... This should do it - switches ->ioctl() to pvfs2_inode_[gs]etxattr() and converts xattr_handler ->[gs]et() to new API. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: set pos after generic_write_checksMike Marshall2015-11-131-1/+8
| | | | | | | if we are appending, generic_write_checks would have updated pos to the end of the file... Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: make pvfs2_inode_read() take iov_iterAl Viro2015-11-131-9/+3Star
| | | | | | | | | | ... and make the only caller use page-backed iov_iter, getting rid of kmap/kunmap *and* of the bug with attempted use of iovec-backed copy_page_to_iter() on a kernel pointer. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: make do_readv_writev() take iov_iterAl Viro2015-11-131-22/+9Star
| | | | | | | | | | no need to build a copy of what the caller already has; what's more, we want the one given to caller properly advanced *and* we shouldn't depend upon it being an iovec-backed one. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: don't bother with splitting iovecsAl Viro2015-11-131-276/+6Star
| | | | | | | | copy_page_{to,from}_iter() advances it just fine *and* it has no problem with partially consumed segments. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: make wait_for_direct_io() take iov_iterAl Viro2015-11-131-12/+13
| | | | | | | | | | | incidentally, insane or compromised server returning *more* than requested on read should not oops the kernel - initialize the iov_iter for read according to the iovec we've got. That's why pvfs_bufmap_copy_to_iovec() needed a separate size argument - we shouldn't abuse iov_iter_count(iter) for passing that. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: make precopy_buffers() take iov_iterAl Viro2015-11-131-8/+5Star
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: make postcopy_buffers() take iov_iterAl Viro2015-11-131-9/+5Star
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: explicitly pass the size to pvfs_bufmap_copy_to_iovec()Al Viro2015-11-131-1/+2
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: fix some checkpatch.pl complaints that had creeped in.Mike Marshall2015-10-051-13/+12Star
| | | | Signed-off-by: Mike Marshall <hubcap@omnibond.com>