summaryrefslogtreecommitdiff
path: root/fs/orangefs/orangefs-kernel.h
AgeCommit message (Collapse)Author
2016-08-02orangefs: Allow dcache and getattr cache time to be configured.Martin Brandenburg
Signed-off-by: Martin Brandenburg <martin@omnibond.com>
2016-08-02orangefs: Cache getattr results.Martin Brandenburg
The userspace component attempts to do this, but this will prevent us from even needing to go into userspace to satisfy certain getattr requests. Signed-off-by: Martin Brandenburg <martin@omnibond.com>
2016-07-28Merge branch 'work.misc' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs updates from Al Viro: "Assorted cleanups and fixes. Probably the most interesting part long-term is ->d_init() - that will have a bunch of followups in (at least) ceph and lustre, but we'll need to sort the barrier-related rules before it can get used for really non-trivial stuff. Another fun thing is the merge of ->d_iput() callers (dentry_iput() and dentry_unlink_inode()) and a bunch of ->d_compare() ones (all except the one in __d_lookup_lru())" * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (26 commits) fs/dcache.c: avoid soft-lockup in dput() vfs: new d_init method vfs: Update lookup_dcache() comment bdev: get rid of ->bd_inodes Remove last traces of ->sync_page new helper: d_same_name() dentry_cmp(): use lockless_dereference() instead of smp_read_barrier_depends() vfs: clean up documentation vfs: document ->d_real() vfs: merge .d_select_inode() into .d_real() unify dentry_iput() and dentry_unlink_inode() binfmt_misc: ->s_root is not going anywhere drop redundant ->owner initializations ufs: get rid of redundant checks orangefs: constify inode_operations missed comment updates from ->direct_IO() prototype change file_inode(f)->i_mapping is f->f_mapping trim fsnotify hooks a bit 9p: new helper - v9fs_parent_fid() debugfs: ->d_parent is never NULL or negative ...
2016-07-05orangefs: fix namespace handlingJann Horn
In orangefs_inode_getxattr(), an fsuid is written to dmesg. The kuid is converted to a userspace uid via from_kuid(current_user_ns(), [...]), but since dmesg is global, init_user_ns should be used here instead. In copy_attributes_from_inode(), op_alloc() and fill_default_sys_attrs(), upcall structures are populated with uids/gids that have been mapped into the caller's namespace. However, those upcall structures are read by another process (the userspace filesystem driver), and that process might be running in another namespace. This effectively lets any user spoof its uid and gid as seen by the userspace filesystem driver. To fix the second issue, I just construct the opcall structures with init_user_ns uids/gids and require the filesystem server to run in the init namespace. Since orangefs is full of global state anyway (as the error message in DUMP_DEVICE_ERROR explains, there can only be one userspace orangefs filesystem driver at once), that shouldn't be a problem. [ Why does orangefs even exist in the kernel if everything does upcalls into userspace? What does orangefs do that couldn't be done with the FUSE interface? If there is no good answer to those questions, I'd prefer to see orangefs kicked out of the kernel. Can that be done for something that shipped in a release? According to commit f7ab093f74bf ("Orangefs: kernel client part 1"), they even already have a FUSE daemon, and the only rational reason (apart from "but most of our users report preferring to use our kernel module instead") given for not wanting to use FUSE is one "in-the-works" feature that could probably be integated into FUSE instead. ] This patch has been compile-tested. Signed-off-by: Jann Horn <jannh@google.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-07-05orangefs: Remove useless xattr prefix argumentsAndreas Gruenbacher
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>
2016-07-05orangefs: Remove useless definesAndreas Gruenbacher
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>
2016-05-29orangefs: constify inode_operationsAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2016-05-02orangefs: don't open-code inode_lock/inode_unlockAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2016-03-26orangefs: fix orangefs_superblock lockingAl Viro
* switch orangefs_remount() to taking ORANGEFS_SB(sb) instead of sb * remove from the list _before_ orangefs_unmount() - request_mutex in the latter will make sure that nothing observed in the loop in ORANGEFS_DEV_REMOUNT_ALL handling will get freed until the end of loop * on removal, keep the forward pointer and zero the back one. That way we can drop and regain the spinlock in the loop body (again, ORANGEFS_DEV_REMOUNT_ALL one) and still be able to get to the rest of the list. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-03-26orangefs: sanitize ->llseek()Al Viro
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>
2016-03-23orangefs: remove needless wrapper around GFP_KERNELMartin Brandenburg
Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-03-23orangefs: remove wrapper around mutex_lock(&inode->i_mutex)Martin Brandenburg
Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-03-23orangefs: use new getattr for revalidate and remove old getattrMartin Brandenburg
Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-03-23orangefs: rename orangefs_inode_getattr to orangefs_inode_old_getattrMartin Brandenburg
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>
2016-03-23orangefs: remove inode->i_lock wrapperMartin Brandenburg
Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-03-09orangefs: make fs_mount_pending staticMartin Brandenburg
Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-02-26orangefs: remove unused 'diff' functionArnd Bergmann
orangefs contains a helper function to calculate the difference between two timeval structures. We are trying to remove all instances of timespec from the kernel, and this one is not used at all, so let's remove it now. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-02-26orangefs: avoid time conversion functionArnd Bergmann
The new orangefs code uses a helper function to read a time field to its private structures from struct iattr. This will conflict with the move to 64-bit timestamps in the kernel and is generally not necessary. This replaces the conversion with a simple cast to time64_t that shows what is going on. As the orangefs-internal representation already uses 64-bit timestamps, there should be no ambiguity to negative values, and the cast ensures that we treat them as times before 1970 on both 32-bit and 64-bit architectures, rather than times after 2038. This patch keeps that behavior. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-02-24orangefs: clean up fill_default_sys_attrsMartin Brandenburg
Size and type are read-only and not in the mask. The times were left unset despite being in the mask. We zero-fill the times since the server will fill them in and we will get the correct time when we fill the inode with getattr. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-02-24orangefs: remove vestigial async io codeMartin Brandenburg
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>
2016-02-24Orangefs: code sanitationMike Marshall
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-02-24Orangefs: clean up orangefs_kernel_op_s comments.Mike Marshall
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-02-19orangefs: get rid of op refcountsAl Viro
not needed anymore Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-02-19orangefs: have ..._clean_interrupted_...() wait for copy to/from daemonAl Viro
* turn all those list_del(&op->list) into list_del_init() * don't pick ops that are already given up in control device ->read()/->write_iter(). * have orangefs_clean_interrupted_operation() notice if op is currently being copied to/from daemon (by said ->read()/->write_iter()) and wait for that to finish. * when we are done copying to/from daemon and find that it had been given up while we were doing that, wake the waiting ..._clean_interrupted_... As the result, we are guaranteed that orangefs_clean_interrupted_operation(op) doesn't return until nobody else can see op. Moreover, we don't need to play with op refcounts anymore. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-02-19orangefs: get rid of op->doneAl Viro
shouldn't be needed now Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-02-19service_operation(): don't block signals, just use ..._killableAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-02-19orangefs: get rid of loop in wait_for_matching_downcall()Al Viro
turn op->waitq into struct completion... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-02-19orangefs: delay freeing slot until cancel completesAl Viro
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>
2016-02-04orangefs: Implement inode_operations->permission().Martin Brandenburg
Thus d_revalidate is not obliged to check on as much, which will eventually lead the way to hammering the filesystem servers much less. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-02-04Orangefs: clean up slab allocation.Mike Marshall
A couple of caches were no longer needed: - iov_iter improvements to orangefs_devreq_write_iter eliminated the need for the dev_req_cache. - removal (months ago) of the old AIO code eliminated the need for the kiocb_cache. Also, deobfuscation of use of GFP_KERNEL when calling kmem_cache_(z)alloc for remaining caches. Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-28orangefs: Fix revalidate.Martin Brandenburg
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>
2016-01-23orangefs: clean up op_alloc()Al Viro
fold orangefs_op_initialize() in there, don't bother locking something nobody else could've seen yet, use kmem_cache_zalloc() instead of explicit memset()... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-23orangefs: move handle_io_error() to file.cAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-23orangefs: don't reinvent completion.h...Al Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-23orangefs: get rid of MSECS_TO_JIFFIESAl Viro
All timeouts are in _seconds_, so all calls are of form MSECS_TO_JIFFIES(n * 1000), which is a convoluted way to spell n * HZ. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-23orangefs: hopefully saner op refcounting and lockingAl Viro
* 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>
2016-01-23orangefs: move wakeups into set_op_state_{serviced,purged}()Al Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-23orangefs: move wakeups into set_op_state_{serviced,purged}()Al Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-23orangefs: make wait_for_...downcall() staticAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-23make orangefs_clean_up_interrupted_operation() staticAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-23orangefs: kill orangefs_inode_s ->listAl Viro
no users... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-23orangefs: get rid of <censored> macrosAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-19Orangefs: make gossip statement more palatable to xtensaMike Marshall
Thanks to Intel's kbuild test robot Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-13Orangefs: rename orangefs_kernel_op_s.aio_ref_count to just ref_count.Mike Marshall
The op structure's ref_count member hasn't got anything to do with asynchronous I/O. Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-04orangefs: Don't pollute global namespaceRichard Weinberger
Prefix public functions with "orangefs_" do don't pollute the global namespace. This fixes a build issue on UML which also has block_signals(). Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2015-12-28orangefs: fix typo in ornagefs_inode_lockArnd Bergmann
Orangefs fails to build on 32-bit SMP configurations due to a simple misspelling, this does the obvious fix. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 575e946125f7 ("Orangefs: change pvfs2 filenames to orangefs") Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2015-12-17Orangefs: don't use deprecated xattr defines.Mike Marshall
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2015-12-17orangefs: Remove ``aligned'' upcall and downcall length macros.Martin Brandenburg
There was previously MAX_ALIGNED_DEV_REQ_(UP|DOWN)SIZE macros which evaluated to MAX_DEV_REQ_(UP|DOWN)SIZE+8. As it is unclear what this is for, other than creating a situation where we accept more data than we can parse, it is removed. Signed-off-by: Mike Marshall <hubcap@omnibond.com> Signed-off-by: Martin Brandenburg <martin@omnibond.com>
2015-12-04Orangefs: change pvfs2 filenames to orangefsMike Marshall
Also changed references within source files that referred to header files whose names had changed. Signed-off-by: Mike Marshall <hubcap@omnibond.com>