summaryrefslogtreecommitdiffstats
path: root/fs/orangefs
AgeCommit message (Collapse)Author
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: make sure that reopening pvfs2-req won't overlap with the end of closeAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-23orangefs: nothing should remain in request list and in hashAl Viro
... otherwise some thread is running in .text that is about to be freed. 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-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-23orangefs: ->poll() doesn't need spinlockAl Viro
not just for list_empty()... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-23orangefs: kill ioctl32 rudimentsAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-23orangefs: ->poll() is only called between successful ->open() and ->release()Al Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-23orangefs: generic_file_open() is pointless for character devicesAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-23orangefs: use DEFINE_MUTEX (and mutex_init() had been too late)Al 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-15Orangefs: add verification to decode_direntsMike Marshall
Also add comments to decode_dirents and make it more readable. Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-13Orangefs: make .statfs gossip_debug more complete.Mike Marshall
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-13Orangefs: define a minimum compatible userspace version.Mike Marshall
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-13Orangefs: change ORANGEFS_VERSION from "Unknown" to "upstream"Mike Marshall
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-13Orangefs: implement .write_iterMike Marshall
Until now, orangefs_devreq_write_iter has just been a wrapper for the old-fashioned orangefs_devreq_writev... linux would call .write_iter with "struct kiocb *iocb" and "struct iov_iter *iter" and .write_iter would just: return pvfs2_devreq_writev(iocb->ki_filp, iter->iov, iter->nr_segs, &iocb->ki_pos); Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2016-01-04orangefs: Fix some more global namespace pollution.Martin Brandenburg
This only changes the names of things, so there is no functional change. Signed-off-by: Martin Brandenburg <martin@omnibond.com> 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>
2016-01-04OrangeFS: constify export_operations structuresJulia Lawall
This export_operations structure is never modified, so declare it as const. Most other structures of this type are already const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2015-12-30Orangefs: don't trigger copy_attributes_to_inode from d_revalidate.Mike Marshall
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-28Orangefs: use kzalloc for kmalloc + memset 0Nicholas Mc Guire
This is an API consolidation only. The use of kmalloc + memset to 0 should be equivalent to kzalloc in this case. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2015-12-17Orangefs: validate resp.listxattr.returned_countMike Marshall
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: Do not unref if there is no bufmap.Martin Brandenburg
Signed-off-by: Mike Marshall <hubcap@omnibond.com> Signed-off-by: Martin Brandenburg <martin@omnibond.com>
2015-12-17orangefs: Remove useless inline qualifier from bufmap functions.Martin Brandenburg
All callers were outside of the file these functions were declared in, so nothing was ever inlined anyway. Further this happens before I/O and any speedup by not having to do a call will be dwarfed by the time it takes to talk to the server. Signed-off-by: Mike Marshall <hubcap@omnibond.com> Signed-off-by: Martin Brandenburg <martin@omnibond.com>
2015-12-17orangefs: Change visibility of several bufmap helpers to static.Martin Brandenburg
Signed-off-by: Mike Marshall <hubcap@omnibond.com> Signed-off-by: Martin Brandenburg <martin@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-15Orangefs: do not finalize bufmap if it was never initialized.Martin Brandenburg
Found by the infant Orangefs fuzzer... Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2015-12-14Orangefs: Don't wait the old-fashioned way.Mike Marshall
Get rid of add_wait_queue, set_current_state, etc, and use the wait_event() model. Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2015-12-14Orangefs: de-uglify orangefs_devreq_writev, and devorangefs-req.c in generalMike Marshall
AV dislikes many parts of orangefs_devreq_writev. Besides making orangefs_devreq_writev more easily readable and better commented, this patch makes an effort to address some of the problems: > The 5th is quietly ignored unless trailer_size is positive and > status is zero. If trailer_size > 0 && status == 0, you verify that > the length of the 5th segment is no more than trailer_size and copy > it to vmalloc'ed buffer. Without bothering to zero the rest of that > buffer out. It was just wrong to allow a 5th segment that is not exactly equal to trailer_size. Now that that's fixed, there's nothing to zero out in the vmalloced buffer - it is exactly the right size to hold the 5th segment. > Another API bogosity: when the 5th segment is present, successful writev() > returns the sum of sizes of the first 4. Added size of 5th segment to writev return... > if concatenation of the first 4 segments is longer than > 16 + sizeof(struct pvfs2_downcall_s) by no more than sizeof(long) => whine > and proceed with garbage. If 4th segment isn't exactly sizeof(struct pvfs2_downcall_s), whine and fail. > if the 32bit value 4 bytes into op->downcall is zero and 64bit > value following it is non-zero, the latter is interpreted as the size of > trailer data. The latter is what userspace claimed was the length of the trailer data. The kernel module now compares it to the trailer iovec's iov_len as a sanity check. > if there's no trailer, the 5th segment (if present) is completely ignored. Whine and fail if there should be no trailer, yet a 5th segment is present. > if vmalloc fails, act as if status (32bit at offset 5 into > op->downcall) had been -ENOMEM and don't look at the 5th segment at all. whine and fail with -ENOMEM. Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2015-12-11Orangef: remove overlooked old-style userspace debug partsMike Marshall
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2015-12-11Orangefs: improve commentsMike Marshall
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2015-12-11Orangefs: don't keep checking stuff in on Friday afternoon.Mike Marshall
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2015-12-04Orangefs: don't expose internal details of pathname resolution to userspace.Mike Marshall
Signed-off-by: Mike Marshall <hubcap@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>
2015-12-03OrangeFS: Change almost all instances of the string PVFS2 to OrangeFS.Yi Liu
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>
2015-11-16fs: out of bounds on stack in iov_iter_advanceAl Viro
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>
2015-11-13Orangefs: Clean up pvfs2_devreq_read.Martin Brandenburg
* Kick invalid arguments out early, so handling them does not clutter the code. * Avoid possibility of race by not releasing lock until completely done. * Do not leak ops (memory) in certain error condition. * Check for more error conditions. * Put module name in all error and debug logs. * Document behavior. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2015-11-13Orangefs: Remove upcall trailers which are not used.Martin Brandenburg
Also removes remnants of iox (readx/writex) which previously used trailers, but no longer exist. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2015-11-13Orangefs: fix gossip statementMike Marshall
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2015-11-13Orangefs: Remove unused #defines from signal blocking code.Martin Brandenburg
Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
2015-11-13Orangefs: set pos after generic_write_checksMike Marshall
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>
2015-11-13orangefs: validate the response in decode_dirents()Al Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>