summaryrefslogtreecommitdiffstats
path: root/fs/orangefs
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'for-linus-4.6-ofs1' of ↵Linus Torvalds2016-04-096-53/+28
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux Pull orangefs fixes from Mike Marshall: "Orangefs cleanups and a strncpy vulnerability fix. Cleanups: - remove an unused variable from orangefs_readdir. - clean up printk wrapper used for ofs "gossip" debugging. - clean up truncate ctime and mtime setting in inode.c - remove a useless null check found by coccinelle. - optimize some memcpy/memset boilerplate code. - remove some useless sanity checks from xattr.c Fix: - fix a potential strncpy vulnerability" * tag 'for-linus-4.6-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux: orangefs: remove unused variable orangefs: Add KERN_<LEVEL> to gossip_<level> macros orangefs: strncpy -> strscpy orangefs: clean up truncate ctime and mtime setting Orangefs: fix ifnullfree.cocci warnings Orangefs: optimize boilerplate code. Orangefs: xattr.c cleanup
| * orangefs: remove unused variableMartin Brandenburg2016-04-081-3/+1
| | | | | | | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
| * orangefs: Add KERN_<LEVEL> to gossip_<level> macrosJoe Perches2016-04-081-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | Emit the logging messages at the appropriate levels. Miscellanea: o Change format to fmt o Use the more common ##__VA_ARGS__ Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
| * orangefs: strncpy -> strscpyMartin Brandenburg2016-04-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It would have been possible for a rogue client-core to send in a symlink target which is not NUL terminated. This returns EIO if the client-core gives us corrupt data. Leave debugfs and superblock code as is for now. Other dcache.c and namei.c strncpy instances are safe because ORANGEFS_NAME_MAX = NAME_MAX + 1; there is always enough space for a name plus a NUL byte. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
| * orangefs: clean up truncate ctime and mtime settingMartin Brandenburg2016-04-081-15/+1
| | | | | | | | | | | | | | | | | | | | | | | | The ctime and mtime are always updated on a successful ftruncate and only updated on a successful truncate where the size changed. We handle the ``if the size changed'' bit. This matches FUSE's behavior. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
| * Orangefs: fix ifnullfree.cocci warningskbuild test robot2016-04-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fs/orangefs/orangefs-debugfs.c:130:2-26: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. NULL check before some freeing functions is not needed. Based on checkpatch warning "kfree(NULL) is safe this check is probably not required" and kfreeaddr.cocci by Julia Lawall. Generated by: scripts/coccinelle/free/ifnullfree.cocci Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
| * Orangefs: optimize boilerplate code.Mike Marshall2016-04-082-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Suggested by David Binderman <dcb314@hotmail.com> The former can potentially be a performance win over the latter. memcpy(d, s, len); memset(d+len, c, size-len); memset(d, c, size); memcpy(d, s, len); Signed-off-by: Mike Marshall <hubcap@omnibond.com>
| * Orangefs: xattr.c cleanupMike Marshall2016-04-081-16/+1
| | | | | | | | | | | | | | | | | | | | 1. It is nonsense to test for negative size_t, suggested by David Binderman <dcb314@hotmail.com> 2. By the time Orangefs gets called, the vfs has ensured that name != NULL, and that buffer and size are sane. Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* | Merge branch 'PAGE_CACHE_SIZE-removal'Linus Torvalds2016-04-043-8/+8
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge PAGE_CACHE_SIZE removal patches from Kirill Shutemov: "PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time ago with promise that one day it will be possible to implement page cache with bigger chunks than PAGE_SIZE. This promise never materialized. And unlikely will. Let's stop pretending that pages in page cache are special. They are not. The first patch with most changes has been done with coccinelle. The second is manual fixups on top. The third patch removes macros definition" [ I was planning to apply this just before rc2, but then I spaced out, so here it is right _after_ rc2 instead. As Kirill suggested as a possibility, I could have decided to only merge the first two patches, and leave the old interfaces for compatibility, but I'd rather get it all done and any out-of-tree modules and patches can trivially do the converstion while still also working with older kernels, so there is little reason to try to maintain the redundant legacy model. - Linus ] * PAGE_CACHE_SIZE-removal: mm: drop PAGE_CACHE_* and page_cache_{get,release} definition mm, fs: remove remaining PAGE_CACHE_* and page_cache_{get,release} usage mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros
| * mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macrosKirill A. Shutemov2016-04-043-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time ago with promise that one day it will be possible to implement page cache with bigger chunks than PAGE_SIZE. This promise never materialized. And unlikely will. We have many places where PAGE_CACHE_SIZE assumed to be equal to PAGE_SIZE. And it's constant source of confusion on whether PAGE_CACHE_* or PAGE_* constant should be used in a particular case, especially on the border between fs and mm. Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much breakage to be doable. Let's stop pretending that pages in page cache are special. They are not. The changes are pretty straight-forward: - <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>; - <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>; - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN}; - page_cache_get() -> get_page(); - page_cache_release() -> put_page(); This patch contains automated changes generated with coccinelle using script below. For some reason, coccinelle doesn't patch header files. I've called spatch for them manually. The only adjustment after coccinelle is revert of changes to PAGE_CAHCE_ALIGN definition: we are going to drop it later. There are few places in the code where coccinelle didn't reach. I'll fix them manually in a separate patch. Comments and documentation also will be addressed with the separate patch. virtual patch @@ expression E; @@ - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT) + E @@ expression E; @@ - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) + E @@ @@ - PAGE_CACHE_SHIFT + PAGE_SHIFT @@ @@ - PAGE_CACHE_SIZE + PAGE_SIZE @@ @@ - PAGE_CACHE_MASK + PAGE_MASK @@ expression E; @@ - PAGE_CACHE_ALIGN(E) + PAGE_ALIGN(E) @@ expression E; @@ - page_cache_get(E) + get_page(E) @@ expression E; @@ - page_cache_release(E) + put_page(E) Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Acked-by: Michal Hocko <mhocko@suse.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | orangefs: minimum userspace version is 2.9.3Martin Brandenburg2016-03-311-1/+1
| | | | | | | | | | | | Version 2.9.4 isn't even released yet. Signed-off-by: Martin Brandenburg <martin@omnibond.com>
* | orangefs: don't put readdir slot twiceMartin Brandenburg2016-03-311-5/+3
|/ | | | | | | | This was quite an oversight. After a readdir, the module could not be unloaded, the number of slots is wrong, and memory near the slot bitmap is possibly corrupt. Oops. Signed-off-by: Martin Brandenburg <martin@omnibond.com>
* orangefs: fix orangefs_superblock lockingAl Viro2016-03-263-58/+47
| | | | | | | | | | | | | | | * 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>
* orangefs: fix do_readv_writev() handling of error halfway throughAl Viro2016-03-251-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: have ->kill_sb() evict the VFS side of things firstAl Viro2016-03-251-3/+3
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: sanitize ->llseek()Al Viro2016-03-252-10/+3
| | | | | | | | | 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-bufmap.h: trim unused junkAl Viro2016-03-251-9/+0
| | | | | 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-254-28/+16
| | | | | | | | 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-253-23/+14
| | | | | | | it's always __orangefs_bufmap Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: get rid of readdir_handle_sAl Viro2016-03-251-63/+30
| | | | | | | | no point, really - we couldn't keep those across the calls of getdents(); it would be too easy to DoS, having all slots exhausted. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* ornagefs: ensure that truncate has an up to date inode sizeMartin Brandenburg2016-03-231-1/+12
| | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: move code which sets i_link to orangefs_inode_getattrMartin Brandenburg2016-03-232-2/+1
| | | | | | | Everything else setting inode->i_ values is in there. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: remove needless wrapper around GFP_KERNELMartin Brandenburg2016-03-232-5/+1
| | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: remove wrapper around mutex_lock(&inode->i_mutex)Martin Brandenburg2016-03-231-6/+2
| | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: refactor inode type or link_target change detectionMartin Brandenburg2016-03-231-41/+36
| | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: use new getattr for revalidate and remove old getattrMartin Brandenburg2016-03-233-325/+49
| | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: use new getattr in inode getattr and permissionMartin Brandenburg2016-03-231-12/+2
| | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com> 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: use new orangefs_inode_getattr to create new inodesMartin Brandenburg2016-03-231-4/+2
| | | | | 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-235-10/+133
| | | | | | | | 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: remove inode->i_lock wrapperMartin Brandenburg2016-03-232-7/+4
| | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: put register_chrdev immediately before register_filesystemMartin Brandenburg2016-03-171-13/+13
| | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: remove paranoia in orangefs_set_inodeMartin Brandenburg2016-03-171-10/+2
| | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: sanitize listxattr and return EIO on impossible valuesMartin Brandenburg2016-03-171-0/+10
| | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: remove unused reference to xattr key lengthMartin Brandenburg2016-03-171-5/+0
| | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: adjust unwind on module init failure.Mike Marshall2016-03-171-4/+3
| | | | Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: fix sloppy cleanups of debugfs and sysfs init failures.Mike Marshall2016-03-143-62/+76
| | | | Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: follow_link -> get_link changeMike Marshall2016-03-142-19/+4
| | | | Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: Extra sanity insurance on buffer before using string functions on it.Mike Marshall2016-03-141-0/+13
| | | | Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: make fs_mount_pending staticMartin Brandenburg2016-03-092-39/+38
| | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: Avoid symlink upcall if target is too long.Martin Brandenburg2016-03-091-0/+3
| | | | | | | | | | | | Previously the client-core detected this condition by sheer luck! Since we used strncpy, no NUL byte would be included on the name. The client-core would call strlen, which would read past the end of its buffer, but return a number large enough that the client-core would return ENAMETOOLONG. 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: add a new gossip statementMike Marshall2016-03-091-0/+4
| | | | Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: improve gossip statementsMike Marshall2016-03-034-21/+49
| | | | Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: update orangefs.txtMike Marshall2016-02-261-2/+2
| | | | | | | | Al Viro has cleaned up the way ops are processed and waited for, now orangefs.txt has an overview of how it works. Several recent related commits have added to the comments in the code as well. Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* Orangefs: code sanitation.Mike Marshall2016-02-263-29/+46
| | | | Signed-off-by: Mike Marshall <hubcap@omnibond.com>
* orangefs: remove unused 'diff' functionArnd Bergmann2016-02-261-11/+0
| | | | | | | | | | 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>
* orangefs: avoid time conversion functionArnd Bergmann2016-02-262-12/+5
| | | | | | | | | | | | | | | | 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>
* orangefs: clean up fill_default_sys_attrsMartin Brandenburg2016-02-241-2/+3
| | | | | | | | | | | 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>
* orangefs: we never lookup with sym_follow setMartin Brandenburg2016-02-242-5/+2
| | | | | Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
OpenPOWER on IntegriCloud