Erez Zadok [Fri, 16 Nov 2007 18:45:09 +0000 (13:45 -0500)]
Unionfs: debugging updates
Don't perform dentry+inode checks unless both are valid.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:10 +0000 (13:45 -0500)]
Unionfs: clear partial read in readpage
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:11 +0000 (13:45 -0500)]
Unionfs: writepage updates
Don't set/reset the PageUptodate flag on our page. Call flush_dcache_page
on the lower page after copy_highpage, and set it uptodate. Call
set_page_dirty right before clear_page_dirty_for_io.
CC: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:12 +0000 (13:45 -0500)]
Unionfs: update cache-coherency detection heuristics
Use a small delay to reduce the number of times unionfs has to detect
changed mtime's/ctime's, and also reduce the potential for false positives.
See Documentation/filesystems/unionfs/concepts.txt for a detailed
discussion.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 04:42:10 +0000 (23:42 -0500)]
Unionfs: use i_size wrappers
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:14 +0000 (13:45 -0500)]
Unionfs: flush and release updates
Remove the totalopens counter which was intended to reduce unnecessary
processing of d_deleted dentries. Move that processing from file_release to
flush.
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 22:39:25 +0000 (17:39 -0500)]
Unionfs: release 2.1.8
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:16 +0000 (13:45 -0500)]
Unionfs/VFS: no need to export 2 symbols in security/security.c
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 04:38:17 +0000 (23:38 -0500)]
Unionfs: don't printk an error if it's due to common copyup
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:19 +0000 (13:45 -0500)]
Unionfs: don't bother validating inode if it has no lower branches
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:20 +0000 (13:45 -0500)]
Unionfs: avoid a deadlock during branch-management on a pivot_root'ed union
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Acked-by: Herton Ronaldo Krzesinski <herton@mandriva.com>
Erez Zadok [Fri, 16 Nov 2007 18:45:21 +0000 (13:45 -0500)]
Unionfs: mmap updates
Rewrite unionfs_writepage to minimize dependence on AOP_WRITEPAGE_ACTIVEATE,
handle memory pressure better, and update documentation. Remove
unionfs_sync_page because it's not needed.
CC: Hugh Dickins <hugh@veritas.com>
CC: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:23 +0000 (13:45 -0500)]
Unionfs: update usage.txt documention
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:24 +0000 (13:45 -0500)]
Unionfs: cleanup permission checking code
Use vfs helpers and avoid redundant checks performed by the VFS already.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 22:39:25 +0000 (17:39 -0500)]
Unionfs: release 2.1.7
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 04:33:39 +0000 (23:33 -0500)]
Unionfs: remove obsolete #define and comment
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Jeff Layton [Fri, 16 Nov 2007 18:45:29 +0000 (13:45 -0500)]
Unionfs: fix unionfs_setattr to handle ATTR_KILL_S*ID
Don't allow unionfs_setattr to trip the BUG() in notify_change. Clear
ATTR_MODE if the either ATTR_KILL_S*ID is set. This also allows the
lower filesystem to interpret these bits in its own way.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Cc: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:30 +0000 (13:45 -0500)]
Unionfs: remove for_writepages nfs workaround
This is no longer necessary since struct writeback_control no longer has a
fs_private field which lower file systems (esp. nfs) use. Plus, unionfs now
defines its own ->writepages method.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:31 +0000 (13:45 -0500)]
Unionfs: convert a printk to pr_debug in release
This is mostly an informational message, not an error.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:32 +0000 (13:45 -0500)]
Unionfs: don't bother validating dentry if it has no lower branches
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:33 +0000 (13:45 -0500)]
Unionfs: don't printk trivial message upon normal rename-copyup
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:34 +0000 (13:45 -0500)]
Unionfs: support lower filesystems without writeback capability
Implement unionfs_writepages. As per
mm/filemap.c:__filemap_fdatawrite_range(), don't call our writepage if the
lower mapping has BDI_CAP_NO_WRITEBACK capability set.
Signed-off-by: Pekka J Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Andrew Morton [Fri, 16 Nov 2007 18:45:35 +0000 (13:45 -0500)]
Unionfs: slab api remove useless ctor parameter and reorder parameters
fs/unionfs/super.c: In function 'unionfs_init_inode_cache':
fs/unionfs/super.c:874: warning: passing argument 5 of 'kmem_cache_create' from incompatible pointer type
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Andrew Morton [Fri, 16 Nov 2007 18:45:36 +0000 (13:45 -0500)]
Unionfs: security convert lsm into a static interface fix
ERROR: "security_inode_permission" [fs/unionfs/unionfs.ko] undefined!
ERROR: "security_file_ioctl" [fs/unionfs/unionfs.ko] undefined!
Need these back.
Cc: "Serge E. Hallyn" <serue@us.ibm.com>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: James Morris <jmorris@namei.org>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 22:39:25 +0000 (17:39 -0500)]
Unionfs: release 2.1.6
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 20:07:27 +0000 (15:07 -0500)]
Unionfs: coding style: avoid lines longer than 80 chars
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:38 +0000 (13:45 -0500)]
Unionfs: coding style: miscellaneous fixes
No braces around single-statement if's.
No externs in .c files.
use <linux/mman.h> not <asm/mman.h>.
Use (foo *) not (foo*).
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:39 +0000 (13:45 -0500)]
Unionfs: coding style: avoid multiple assignments on same line
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 04:32:04 +0000 (23:32 -0500)]
Unionfs: coding style: take assignments out of "if" conditions
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:41 +0000 (13:45 -0500)]
Unionfs: coding style: proper spacing
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 04:30:13 +0000 (23:30 -0500)]
Unionfs: use braces in both branches of conditionals
As per CodingStyle, if one branch of an if-then-else has braces because it
has multiple statements, then the other branch should have braces too, even
if the other branch has only one statement in it.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 04:27:52 +0000 (23:27 -0500)]
Unionfs: remove periods from the end of printk strings
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 04:27:19 +0000 (23:27 -0500)]
Unionfs: update/assign a KERN_* level to all printk statements
Also use pr_info() instead of printk(KERN_INFO ...)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:45 +0000 (13:45 -0500)]
Unionfs: add missing newlines in printk's
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 21:38:45 +0000 (16:38 -0500)]
Unionfs: convert all appropriate printk's to pr_debug calls
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:47 +0000 (13:45 -0500)]
Unionfs: use pr_debug() instead of custom dprintk()
Also turn on DEBUG if CONFIG_UNION_FS_DEBUG is on
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:48 +0000 (13:45 -0500)]
Unionfs: use page_offset() helper
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:49 +0000 (13:45 -0500)]
Unionfs: properly indent static struct
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 04:12:13 +0000 (23:12 -0500)]
Unionfs: use UNIONFS_NAME macro
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 04:11:00 +0000 (23:11 -0500)]
Unionfs: use consistent printk prefixes
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 04:09:39 +0000 (23:09 -0500)]
Unionfs: minor comment cleanups
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:54 +0000 (13:45 -0500)]
Unionfs: compile if debug is off
Signed-of-by: John Johansen <jjohansen@suse.de>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 21:37:51 +0000 (16:37 -0500)]
Unionfs: add un/likely on conditionals
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:45:55 +0000 (13:45 -0500)]
Unionfs: display informational messages only if debug is on
This is to avoid filling the console/logs with messages that are primarily
of debugging use.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Acked-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 22:39:25 +0000 (17:39 -0500)]
Unionfs: release 2.1.5
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 21:36:27 +0000 (16:36 -0500)]
Unionfs: use poison.h for safe poison pointers
This also fixes a compile warning on 64-bit systems.
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 19:58:02 +0000 (14:58 -0500)]
Unionfs: lower nameidata support for nfsv4
Pass nameidata structures as needed to the lower file system, support
LOOKUP_ACCESS/OPEN intents. This makes unionfs work on top of nfsv4.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 03:37:39 +0000 (22:37 -0500)]
Unionfs: add lower nameidata debugging support
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Sun, 18 Nov 2007 03:36:23 +0000 (22:36 -0500)]
Unionfs: minor coding style updates
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez Zadok [Fri, 16 Nov 2007 18:46:16 +0000 (13:46 -0500)]
Unionfs: cast page->index loff_t before shifting
Fixes bugs in number promotion/demotion computation, as per
<http://lkml.org/lkml/2007/9/20/17>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 18 Nov 2007 22:39:25 +0000 (17:39 -0500)]
Unionfs: release 2.1.4
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:18 +0000 (13:46 -0500)]
Unionfs: cache-coherency fixes
Do not update mtime if there is no upper branch for the inode. This
prevents from calling unionfs_lower_inode_idx() with a negative index, which
triggers a bug.
Signed-off-by: Olivier Blin <blino@mandriva.com>
Acked-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:19 +0000 (13:46 -0500)]
Unionfs: display informational messages only if debug is on
This is to avoid filling the console/logs with messages that are primarily
of debugging use.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:20 +0000 (13:46 -0500)]
Unionfs: use int in unionfs_d_revalidate
We have to use an int, even though unionfs_d_revalidate calls other routines
that return only true/false, b/c ->d_revalidate is allowed to return a
negative errno number.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:21 +0000 (13:46 -0500)]
Unionfs: documentation updates/corrections
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 18 Nov 2007 22:39:25 +0000 (17:39 -0500)]
Unionfs: release 2.1.3
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 18 Nov 2007 03:34:55 +0000 (22:34 -0500)]
Unionfs: cache coherency after lower objects are removed
Prevent an oops if a lower file is deleted and then it is stat'ed from the
upper layer. Ensure that we return a negative dentry so the user will get
an ENOENT. Properly dput/mntput so we don't leak references at the lower
file system.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 18 Nov 2007 03:33:46 +0000 (22:33 -0500)]
Unionfs: unionfs_lookup locking consistency
Ensure that our lookup locking is consistent and symmetric: if a lock
existed before calling lookup_backend, it should remain so; only if
performing a lookup of a known new dentry, should lookup_backend return a
newly-locked dentry-inode info (and only if there was no error). Document
this behavior. This cleanup allowed us to remove two unnecessary int
declarations.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:25 +0000 (13:46 -0500)]
Unionfs: use boolean type in unionfs_d_revalidate
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:26 +0000 (13:46 -0500)]
Unionfs: add missing newlines to printks
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:27 +0000 (13:46 -0500)]
Unionfs: remove unnecessary comment
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:28 +0000 (13:46 -0500)]
Unionfs: documentation updates
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:29 +0000 (13:46 -0500)]
Unionfs: use bool type in dentry and file revalidation code
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:30 +0000 (13:46 -0500)]
Unionfs: cache-coherency fix for is_newer_lower
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 18 Nov 2007 03:33:02 +0000 (22:33 -0500)]
Unionfs: import Jeff's fixes from korg
64 bit fixes for debugging support.
Use bool type where appropriate.
Minor code cleanups.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Josef 'Jeff' Sipek [Fri, 16 Nov 2007 18:46:31 +0000 (13:46 -0500)]
Unionfs: Remove unused #defines
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Josef 'Jeff' Sipek [Fri, 16 Nov 2007 18:46:32 +0000 (13:46 -0500)]
Unionfs: Simplify unionfs_get_nlinks
Since we set the right value for d_type in readdir, there's really no point
in having to calculate the number of directory links. Some on-disk
filesystems don't even store the number of links for directories.
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Josef 'Jeff' Sipek [Sun, 18 Nov 2007 03:27:29 +0000 (22:27 -0500)]
Unionfs: unionfs_create rewrite
The code was hard to follow and violated some invariants (e.g., never modify
a read only branch, and always create on branch 0).
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:34 +0000 (13:46 -0500)]
Unionfs: document lockdep issues
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:35 +0000 (13:46 -0500)]
Unionfs: support CONFIG_PREEMPT_RT
Use compat_rw_semaphore when using the real-time preemption patches.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 18 Nov 2007 22:39:25 +0000 (17:39 -0500)]
Unionfs: release 2.1.2
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 18 Nov 2007 03:07:11 +0000 (22:07 -0500)]
Unionfs: imported fixes from korg branch's take-3 series
- removed EACCES/EROFS text from issues.txt
- updated sioq.[hc] copyright dates to 2006 (not earlier)
- added small XXX comment to xattr copyup code (selinux CAP_FOWNER stuff) to
say that entire copyup code should be moved to SIOQ.
- copyup_xattr: renamed name_list_orig -> name_list_buf
- multi-line static inline unionfs_xattr_kfree
- rewrote unionfs_interpose a bit cleaner (no backward goto's, better
variable names, use small util fxn, etc.)
- introduced CONFIG_UNION_FS_DEBUG instead of hand-editing makefile
- unionfs_mntget/put cleanups
- bug fix to is_robranch_idx (thanks to Patrick Aussems). Fixed bug #571.
- fixed a couple of important bugs in our init/release_lower_nd
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 18 Nov 2007 22:39:25 +0000 (17:39 -0500)]
Unionfs: release 2.1.1.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:39 +0000 (13:46 -0500)]
Unionfs: minor usage.txt documentation fix
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 18 Nov 2007 19:08:27 +0000 (14:08 -0500)]
Unionfs: imported fixes from korg branch
Export release_open_intent.
SElinux: xattr fixes (CAP_FOWNER).
unionfs_xattr_kfree inline function.
alloc_lower_nd -> init_lower_nd.
free_lower_nd -> release_lower_nd.
unionfs_purge_extras -> unionfs_postcopyup_release.
unionfs_inherit_mnt -> unionfs_postcopyup_setmnt.
minor code/copyright cleanups.
MS_SILENT remount fix.
simplify unionfs_mntget/put.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 18 Nov 2007 02:45:45 +0000 (21:45 -0500)]
Unionfs: back-port stuff from Jeff's korg branch to per-kernel branches
Just a bunch of code cleanups: no functionality changed.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:42 +0000 (13:46 -0500)]
MM/VFS: prevent compile warnings/errors with unknown struct super_block
This is a temp fix for 2.6.23-rc2.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 18 Nov 2007 04:45:46 +0000 (23:45 -0500)]
Unionfs/eCryptfs: remove lookup_one_len_nd and LOOKUP_ONE code
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 18 Nov 2007 22:37:25 +0000 (17:37 -0500)]
Unionfs: support incremental versions
Also: release Unionfs 2.1 (since code has gotten much more stable since 2.0)
Unionfs will now report its precise version number and the kernel it was
meant for, upon module loading. This is useful for maintenance purposes:
users can report the precise release number of Unionfs, and it also helps
prevent running older versions when newer ones are intended, or mixing
versions among supported kernels.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:46 +0000 (13:46 -0500)]
Unionfs: check for immutable files before read-only branches
Immutable files should never be allowed to be copied-up on write, even if
they're on read-only file systems or branches.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:47 +0000 (13:46 -0500)]
Unionfs: mmap fixes to unionfs_writepage
Don't call unlock_page on lower_page unless lower ->writepage failed.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:48 +0000 (13:46 -0500)]
Unionfs: rewrite cleanup_file more cleanly
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:49 +0000 (13:46 -0500)]
Unionfs: improved printk upon copyup
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:49 +0000 (13:46 -0500)]
Unionfs: xattr copyup fixes
Rewrote xattr copyup code more cleanly; documented it better; eliminate one
possible leak in error path; and ignore another impossible copyup-time error
which caused fanout invariant violations under memory-pressure conditions.
Don't use vmalloc when allocating xattr buffers, as the VFS no longer does
so (just use kmalloc). Eliminate unionfs_xattr_free which is now just plain
kfree.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:50 +0000 (13:46 -0500)]
Unionfs: fixes to cache-coherency checking code
Under memory pressure, in_newer_lower could be called on uninitialized
dentries or inodes. So return 0 safely in that case (rather than oops).
This is OK because is_newer_lower will be called again on the same object(s)
and cache-coherency will be validated and maintained then.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:51 +0000 (13:46 -0500)]
Unionfs: mmap fixes to unionfs_writepage
This patch fixes hangs when calling sync(2) on memory-pressured systems.
Call find_lock_page instead of grab_cache_page. We used to call
grab_cache_page(), but that was unnecessary as it would have tried to create
a new lower page if it didn't exist, leading to deadlocks (esp. under
memory-pressure conditions, when it is really a bad idea to *consume* more
memory). Instead, we assume the lower page exists, and if we can find it,
then we ->writepage on it; if we can't find it, then it couldn't have
disappeared unless the kernel already flushed it, in which case we're still
OK. This is especially correct if wbc->sync_mode is WB_SYNC_NONE (as per
Documentation/filesystems/vfs.txt). If we can't flush our page because we
can't find a lower page, then at least we re-mark our page as dirty, and
return AOP_WRITEPAGE_ACTIVATE as the VFS expects us to. (Note, if in the
future it'd turn out that we have to find a lower page no matter what, then
we'd have to resort to RAIF's page pointer flipping trick.)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 18 Nov 2007 02:35:17 +0000 (21:35 -0500)]
Unionfs: bugfix when mounting readonly exported NFS volumes (was: nfsro)
When stacking on top of readonly exported NFS volumes, which are mounted
locally read-write, attempting to create a new file yields the proper EROFS.
But attempting to modify an existing file returns an EACCES, which
interferes with unionfs's copyup policy: only EROFS triggers a copyup,
whereas EACCES does not (and shouldn't -- that'd be a security hole). The
old unionfs 1.x attempted to workaround this EACCES condition by supporting
a special unionfs mount option called 'nfsro'; support for this option was
left in the latest unionfs 2.0, but the mount option was not made available
until we could properly investigate this issue with the latest NFS code.
This patch removes all remnants of this 'nfsro' support. It is no longer
needed. Instead, users can use the existing per-branch 'ro' unionfs mount
option, which would properly return the appropriate status conditions back
from unionfs_permission. These return conditions result in a copyup if and
only if needed, even for readonly exported NFS volumes. In effect, unionfs
per-branch 'ro' option now simulates a true readonly localhost mount.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Adrian Bunk [Sun, 18 Nov 2007 02:24:53 +0000 (21:24 -0500)]
[PATCH] unionfs: make functions static
This patch makes some needlessly global functions static.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Erez_Zadok [Sun, 18 Nov 2007 02:22:54 +0000 (21:22 -0500)]
Unionfs: pass nameidata intent information to lower level file systems
As of 2.6.23-rc1, nfs2 and nfs3, like nfs4 before them, begin relying on the
struct nameidata and especially the intent information, which is passed to
vfs_create() and others. So, as of now, unionfs properly creates and passes
that intent data to the lower level file system. Currently supported are
LOOKUP_CREATE open intents. Others can be supported in the future
incrementally.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:55 +0000 (13:46 -0500)]
Unionfs: kmem_cache_create doesn't take a dtor argument any longer
Porting unionfs to 2.6.23-rc1
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:56 +0000 (13:46 -0500)]
Unionfs: ensure cache coherency in unionfs_fsync/fasync
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:57 +0000 (13:46 -0500)]
Unionfs: implement native unionfs_fsync/unionfs_fasync methods
Unionfs is not a block-based file system, but it has to work with both
block-based file systems and non-block-based ones (i.e., when
CONFIG_BLOCK=n). We used to define our ->fsync method to file_fsync, but
that's wrong because file_fsync partially depends on CONFIG_BLOCK=y. And we
didn't define an fasync method: now we have both. Moreover, at best,
file_fsync would have caused unionfs to sync up one lower branch---but as a
fanout file system, we need to sync up all valid lower branches.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Conflicts:
fs/unionfs/file.c
Erez_Zadok [Fri, 16 Nov 2007 18:46:58 +0000 (13:46 -0500)]
Unionfs: small documentation fix to usage.txt
Reported by Daniel Farrugia.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:46:59 +0000 (13:46 -0500)]
Unionfs: mmap fixes to ->writepage/readpage/sync_page
unionfs_writepage: handle true errors differently from
AOP_WRITEPAGE_ACTIVATE conditions returned by lower file systems (such as
tmpfs).
unionfs_readpage: call flush_dcache_page as required.
unionfs_sync_page: don't call grab_cache_page to get the lower page, because
that function does too much and could lead to deadlocks. Instead, call the
lighter-weight find_lock_page.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:47:00 +0000 (13:47 -0500)]
Unionfs: branch-management bugfix to unionfs_file_revalidate
If we re-opened the file on a different branch than the original one, and
only if this was due to a new branch inserted, then update the mnt counts of
the old and new branches accordingly.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:47:01 +0000 (13:47 -0500)]
Unionfs: cleanup: break line longer than 80 chars
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:47:02 +0000 (13:47 -0500)]
Unionfs: fix minor typo in revalidate_chain comment
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:47:03 +0000 (13:47 -0500)]
Unionfs: bugfix: don't call branchget() until dentry_open succeeded
If dentry_open fails, we incorrectly have incremented our branch counts
which would prevent unionfs from being unmounted (EBUSY).
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:47:04 +0000 (13:47 -0500)]
Unionfs: branch-management bug-fix to lower mnt counts
When we revalidate opened files, the files may point to a different set of
files on the lower branches: this could happen especially if we insert a new
leftmost branch which happens to have duplicate file names of already-open
files in lower-priority branches. In this case, update the mnt counts of
the old and new branches which hold the file accordingly. Without this fix,
the mntcnt of one branch is going to be one too high; and another will be
one too low.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 16 Nov 2007 18:47:05 +0000 (13:47 -0500)]
Unionfs: use igrab instead of atomic_inc inode refcnt
In branch management code, use igrab() which is better than directly
incrementing the lower inode reference count.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>