summaryrefslogtreecommitdiff
path: root/fs
AgeCommit message (Collapse)Author
2014-03-21ufs: sb mutex merge + mutex_destroyFabian Frederick
788257d6101d9 ("ufs: remove the BKL") replaced BKL with mutex protection using functions lock_ufs, unlock_ufs and struct mutex 'mutex' in sb_info. b6963327e052 ("ufs: drop lock/unlock super") removed lock/unlock super and added struct mutex 's_lock' in sb_info. Those 2 mutexes are generally locked/unlocked at the same time except in allocation (balloc, ialloc). This patch merges the 2 mutexes and propagates first commit solution. It also adds mutex destruction before kfree during ufs_fill_super failure and ufs_put_super. Signed-off-by: Fabian Frederick <fabf@skynet.be> Cc: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-03-21fs/ufs: remove unused ufs_super_block_third pointerChristian Engelmayer
Pointer 'usb3' to struct ufs_super_block_third acquired via ubh_get_usb_third() is never used in function ufs_read_cylinder_structures(= ). Thus remove it. Detected by Coverity: CID 139939. Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Cc: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-03-21fs/ufs: remove unused ufs_super_block_second pointerChristian Engelmayer
Pointer 'usb2' to struct ufs_super_block_second acquired via ubh_get_usb_second() is never used in function ufs_statfs(). Thus remove it. Detected by Coverity: CID 139940. Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Cc: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-03-21fs/ufs: remove unused ufs_super_block_first pointerChristian Engelmayer
Remove occurences of unused pointers to struct ufs_super_block_first that w= ere acquired via ubh_get_usb_first(). Detected by Coverity: CID 139929 - CID 139936, CID 139940. Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Cc: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-03-21fs/ufs/super.c: add __init to init_inodecache()Fabian Frederick
init_inodecache is only called by __init init_ufs_fs. Signed-off-by: Fabian Frederick <fabf@skynet.be> Cc: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2014-03-21Merge branch 'akpm-current/current'Stephen Rothwell
Conflicts: fs/fs-writeback.c
2014-03-21Merge remote-tracking branch 'compat/compat'Stephen Rothwell
Conflicts: fs/compat.c ipc/compat_mq.c
2014-03-21Merge remote-tracking branch 'aio/master'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'cgroup/for-next'Stephen Rothwell
Conflicts: mm/memcontrol.c
2014-03-21Merge remote-tracking branch 'driver-core/driver-core-next'Stephen Rothwell
Conflicts: arch/x86/Kconfig
2014-03-21Merge remote-tracking branch 'workqueues/for-next'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'tip/auto-latest'Stephen Rothwell
Conflicts: arch/arm/mach-imx/pm-imx6q.c arch/arm/mach-shmobile/Kconfig arch/arm/mach-zynq/Kconfig arch/x86/include/asm/topology.h arch/x86/kernel/cpu/perf_event_intel_uncore.c arch/x86/pci/numaq_32.c arch/x86/pci/visws.c drivers/clocksource/Kconfig drivers/pci/Makefile drivers/video/Kconfig drivers/video/Makefile drivers/video/fbdev/sgivwfb.c
2014-03-21Merge remote-tracking branch 'devicetree/devicetree/next'Stephen Rothwell
Conflicts: drivers/of/of_net.c include/asm-generic/vmlinux.lds.h
2014-03-21Merge remote-tracking branch 'audit/master'Stephen Rothwell
Conflicts: arch/mips/include/asm/syscall.h arch/mips/kernel/ptrace.c arch/powerpc/Kconfig arch/x86/Kconfig init/Kconfig kernel/audit.c
2014-03-21Merge remote-tracking branch 'trivial/for-next'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'block/for-next'Stephen Rothwell
Conflicts: block/blk-mq.c fs/bio-integrity.c
2014-03-21Merge remote-tracking branch 'drm/drm-next'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'l2-mtd/master'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'dlm/next'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'file-private-locks/linux-next'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'xfs/for-next'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'nfsd/nfsd-next'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'nfs/linux-next'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'logfs/master'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'gfs2/master'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'fuse/for-next'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'f2fs/dev'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'ext4/dev'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'ext3/for_next'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'ecryptfs/next'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'ia64/next'Stephen Rothwell
2014-03-21Merge remote-tracking branch 'arm64/for-next/core'Stephen Rothwell
2014-03-20proc: Update get proc_pid_cmdline() to use mm.h helpersWilliam Roberts
Re-factor proc_pid_cmdline() to use get_cmdline() helper from mm.h. Acked-by: David Rientjes <rientjes@google.com> Acked-by: Stephen Smalley <sds@tycho.nsa.gov> Acked-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: William Roberts <wroberts@tresys.com> Acked-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: Eric Paris <eparis@redhat.com>
2014-03-20Merge branch 'x86/x32'Ingo Molnar
2014-03-20Merge branch 'x86/efi'Ingo Molnar
2014-03-20Merge branch 'timers/nohz'Ingo Molnar
2014-03-20Merge branch 'timers/core'Ingo Molnar
2014-03-20Merge branch 'core/rcu'Ingo Molnar
2014-03-19locks: make locks_mandatory_area check for file-private locksJeff Layton
Allow locks_mandatory_area() to handle file-private locks correctly. If there is a file-private lock set on an open file and we're doing I/O via the same, then that should not cause anything to block. Handle this by first doing a non-blocking FL_ACCESS check for a file-private lock, and then fall back to checking for a classic POSIX lock (and possibly blocking). Note that this approach is subject to the same races that have always plagued mandatory locking on Linux. Reported-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Jeff Layton <jlayton@redhat.com>
2014-03-19locks: fix locks_mandatory_locked to respect file-private locksJeff Layton
As Trond pointed out, you can currently deadlock yourself by setting a file-private lock on a file that requires mandatory locking and then trying to do I/O on it. Avoid this problem by plumbing some knowledge of file-private locks into the mandatory locking code. In order to do this, we must pass down information about the struct file that's being used to locks_verify_locked. Reported-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Acked-by: J. Bruce Fields <bfields@redhat.com>
2014-03-19locks: require that flock->l_pid be set to 0 for file-private locksJeff Layton
Neil Brown suggested potentially overloading the l_pid value as a "lock context" field for file-private locks. While I don't think we will probably want to do that here, it's probably a good idea to ensure that in the future we could extend this API without breaking existing callers. Typically the l_pid value is ignored for incoming struct flock arguments, serving mainly as a place to return the pid of the owner if there is a conflicting lock. For file-private locks, require that it currently be set to 0 and return EINVAL if it isn't. If we eventually want to make a non-zero l_pid mean something, then this will help ensure that we don't break legacy programs that are using file-private locks. Cc: Neil Brown <neilb@suse.de> Signed-off-by: Jeff Layton <jlayton@redhat.com>
2014-03-19locks: add new fcntl cmd values for handling file private locksJeff Layton
Due to some unfortunate history, POSIX locks have very strange and unhelpful semantics. The thing that usually catches people by surprise is that they are dropped whenever the process closes any file descriptor associated with the inode. This is extremely problematic for people developing file servers that need to implement byte-range locks. Developers often need a "lock management" facility to ensure that file descriptors are not closed until all of the locks associated with the inode are finished. Additionally, "classic" POSIX locks are owned by the process. Locks taken between threads within the same process won't conflict with one another, which renders them useless for synchronization between threads. This patchset adds a new type of lock that attempts to address these issues. These locks conflict with classic POSIX read/write locks, but have semantics that are more like BSD locks with respect to inheritance and behavior on close. This is implemented primarily by changing how fl_owner field is set for these locks. Instead of having them owned by the files_struct of the process, they are instead owned by the filp on which they were acquired. Thus, they are inherited across fork() and are only released when the last reference to a filp is put. These new semantics prevent them from being merged with classic POSIX locks, even if they are acquired by the same process. These locks will also conflict with classic POSIX locks even if they are acquired by the same process or on the same file descriptor. The new locks are managed using a new set of cmd values to the fcntl() syscall. The initial implementation of this converts these values to "classic" cmd values at a fairly high level, and the details are not exposed to the underlying filesystem. We may eventually want to push this handing out to the lower filesystem code but for now I don't see any need for it. Also, note that with this implementation the new cmd values are only available via fcntl64() on 32-bit arches. There's little need to add support for legacy apps on a new interface like this. Signed-off-by: Jeff Layton <jlayton@redhat.com>
2014-03-19locks: skip deadlock detection on FL_FILE_PVT locksJeff Layton
It's not really feasible to do deadlock detection with FL_FILE_PVT locks since they aren't owned by a single task, per-se. Deadlock detection also tends to be rather expensive so just skip it for these sorts of locks. Also, add a FIXME comment about adding more limited deadlock detection that just applies to ro -> rw upgrades, per Andy's request. Cc: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Jeff Layton <jlayton@redhat.com>
2014-03-19locks: pass the cmd value to fcntl_getlk/getlk64Jeff Layton
Once we introduce file private locks, we'll need to know what cmd value was used, as that affects the ownership and whether a conflict would arise. Signed-off-by: Jeff Layton <jlayton@redhat.com>
2014-03-19locks: report l_pid as -1 for FL_FILE_PVT locksJeff Layton
FL_FILE_PVT locks are no longer tied to a particular pid, and are instead inheritable by child processes. Report a l_pid of '-1' for these sorts of locks since the pid is somewhat meaningless for them. This precedent comes from FreeBSD. There, POSIX and flock() locks can conflict with one another. If fcntl(F_GETLK, ...) returns a lock set with flock() then the l_pid member cannot be a process ID because the lock is not held by a process as such. Signed-off-by: Jeff Layton <jlayton@redhat.com>
2014-03-19locks: make /proc/locks show IS_FILE_PVT locks with a P suffixJeff Layton
In a later patch, we'll be adding a new type of lock that's owned by the struct file instead of the files_struct. Those sorts of locks will be flagged with a new IS_FILE_PVT flag. Add a "P" suffix to the POSIX lock output in /proc/locks for locks that have FL_FILE_PVT set to distinguish them from "classic" POSIX locks. Signed-off-by: Jeff Layton <jlayton@redhat.com>
2014-03-19GFS2: inline function gfs2_set_modeBob Peterson
Here is a revised patch based on Steve's feedback: This patch eliminates function gfs2_set_mode which was only called in one place, and always returned 0. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2014-03-19GFS2: Remove extraneous function gfs2_security_initBob Peterson
This patch eliminates function gfs2_security_init in favor of just calling security_inode_init_security directly. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2014-03-19GFS2: Increase the max number of ACLsBob Peterson
This patch increases the maximum number of ACLs from 25 to 300 for a 4K block size. The value is adjusted accordingly if the block size is smaller. Note that this is an arbitrary limit with a performance tradeoff, and that the physical limit is slightly over 500. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2014-03-19NFSv4: Ensure we respect soft mount timeouts during trunking discoveryTrond Myklebust
Tested-by: Steve Dickson <steved@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>