Erez_Zadok [Thu, 20 Sep 2007 04:14:33 +0000 (00:14 -0400)]
Unionfs: release 2.1.4
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Thu, 20 Sep 2007 03:52:18 +0000 (23:52 -0400)]
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 [Thu, 20 Sep 2007 04:59:05 +0000 (00:59 -0400)]
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 [Thu, 20 Sep 2007 01:18:35 +0000 (21:18 -0400)]
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 [Thu, 20 Sep 2007 01:12:37 +0000 (21:12 -0400)]
Unionfs: documentation updates/corrections
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Tue, 11 Sep 2007 03:38:02 +0000 (23:38 -0400)]
Unionfs: release 2.1.3
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Tue, 11 Sep 2007 00:19:29 +0000 (20:19 -0400)]
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 [Tue, 11 Sep 2007 00:15:37 +0000 (20:15 -0400)]
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 [Tue, 11 Sep 2007 00:10:31 +0000 (20:10 -0400)]
Unionfs: use boolean type in unionfs_d_revalidate
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Tue, 11 Sep 2007 00:09:41 +0000 (20:09 -0400)]
Unionfs: add missing newlines to printks
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Thu, 6 Sep 2007 04:41:59 +0000 (00:41 -0400)]
Unionfs: remove unnecessary comment
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Thu, 6 Sep 2007 04:40:02 +0000 (00:40 -0400)]
Unionfs: documentation updates
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Thu, 6 Sep 2007 04:35:12 +0000 (00:35 -0400)]
Unionfs: use bool type in dentry and file revalidation code
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Thu, 6 Sep 2007 04:42:56 +0000 (00:42 -0400)]
Unionfs: cache-coherency fix for is_newer_lower
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Thu, 6 Sep 2007 02:18:44 +0000 (22:18 -0400)]
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 [Mon, 3 Sep 2007 21:32:07 +0000 (17:32 -0400)]
Unionfs: Remove unused #defines
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Josef 'Jeff' Sipek [Mon, 3 Sep 2007 21:22:45 +0000 (17:22 -0400)]
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 [Fri, 31 Aug 2007 23:31:58 +0000 (19:31 -0400)]
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, 31 Aug 2007 15:24:06 +0000 (11:24 -0400)]
Unionfs: document lockdep issues
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 24 Aug 2007 14:42:56 +0000 (10:42 -0400)]
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 [Wed, 22 Aug 2007 22:08:48 +0000 (18:08 -0400)]
Unionfs: release 2.1.2
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Wed, 22 Aug 2007 20:49:09 +0000 (16:49 -0400)]
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, 19 Aug 2007 19:54:06 +0000 (15:54 -0400)]
Unionfs: release 2.1.1.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 19 Aug 2007 19:22:43 +0000 (15:22 -0400)]
Unionfs: minor usage.txt documentation fix
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sat, 18 Aug 2007 20:02:02 +0000 (16:02 -0400)]
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 [Sat, 11 Aug 2007 18:01:08 +0000 (14:01 -0400)]
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 [Sat, 11 Aug 2007 02:21:05 +0000 (22:21 -0400)]
Revert "bugfix: add MODULE_LICENSE to mtdsuper module so it loads"
This reverts commit
924185024a661a3a0fb772fde4ce178e587ed018.
Erez_Zadok [Thu, 9 Aug 2007 21:04:19 +0000 (17:04 -0400)]
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 [Tue, 7 Aug 2007 22:51:20 +0000 (18:51 -0400)]
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 [Wed, 1 Aug 2007 14:29:42 +0000 (10:29 -0400)]
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 [Tue, 31 Jul 2007 23:25:55 +0000 (19:25 -0400)]
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 [Tue, 31 Jul 2007 22:12:25 +0000 (18:12 -0400)]
Unionfs: rewrite cleanup_file more cleanly
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Tue, 31 Jul 2007 07:58:50 +0000 (03:58 -0400)]
Unionfs: improved printk upon copyup
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Tue, 31 Jul 2007 07:53:47 +0000 (03:53 -0400)]
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 [Tue, 31 Jul 2007 07:33:24 +0000 (03:33 -0400)]
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 [Tue, 31 Jul 2007 07:29:50 +0000 (03:29 -0400)]
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 [Thu, 26 Jul 2007 04:04:58 +0000 (00:04 -0400)]
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 [Mon, 2 Jul 2007 18:27:57 +0000 (14:27 -0400)]
[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 [Mon, 23 Jul 2007 07:13:01 +0000 (03:13 -0400)]
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 [Mon, 23 Jul 2007 01:53:49 +0000 (21:53 -0400)]
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 [Sun, 22 Jul 2007 05:10:45 +0000 (01:10 -0400)]
Unionfs: ensure cache coherency in unionfs_fsync/fasync
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 22 Jul 2007 03:56:16 +0000 (23:56 -0400)]
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 [Sun, 22 Jul 2007 00:22:38 +0000 (20:22 -0400)]
Unionfs: small documentation fix to usage.txt
Reported by Daniel Farrugia.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sat, 21 Jul 2007 06:44:32 +0000 (02:44 -0400)]
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 [Sat, 21 Jul 2007 06:38:14 +0000 (02:38 -0400)]
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 [Tue, 17 Jul 2007 07:18:25 +0000 (03:18 -0400)]
Unionfs: cleanup: break line longer than 80 chars
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Tue, 17 Jul 2007 06:58:15 +0000 (02:58 -0400)]
Unionfs: fix minor typo in revalidate_chain comment
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Tue, 17 Jul 2007 03:56:26 +0000 (23:56 -0400)]
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 [Tue, 17 Jul 2007 03:54:11 +0000 (23:54 -0400)]
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 [Tue, 17 Jul 2007 03:45:46 +0000 (23:45 -0400)]
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>
Erez_Zadok [Tue, 17 Jul 2007 03:42:55 +0000 (23:42 -0400)]
Unionfs: cache-coherency: update times of root inode after branch management
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Tue, 17 Jul 2007 03:40:07 +0000 (23:40 -0400)]
Unionfs: debugging: don't oops if sb->s_root is NULL
If we're calling show_branch_counts very early during mount or late during
unmount, don't oops if the s_root is already NULL.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Tue, 17 Jul 2007 03:38:30 +0000 (23:38 -0400)]
Unionfs: debugging: show inode reference counts for all branches
Another useful utility function for debugging, to show the inode refcnt's
of all lower inodes.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Tue, 17 Jul 2007 03:35:19 +0000 (23:35 -0400)]
Unionfs: fix small typo in comment
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sat, 14 Jul 2007 07:25:02 +0000 (03:25 -0400)]
Unionfs: bugfix -- set copied up open file mode to read and write
When we copyup a file, we used to set the new file's open mode to write
only. But we need read permission too. We need write permission because
we're creating a new file; and we need read permission because the original
file had to have been readable. If we don't set the new files permission to
BOTH read and write, we get -EBADF when trying calling vfs_read/vfs_write on
a copied up file. (This fix is somewhat related to unionfs_readpage fixes
that use vfs_read instead of calling the lower readpage.)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sat, 14 Jul 2007 07:36:15 +0000 (03:36 -0400)]
Unionfs: rewrite do_unionfs_readpage to use vfs_read (bugfix)
In do_unionfs_readpage, we used to call the lower file system's ->readpage.
However, some file systems (e.g., tmpfs) don't implement ->readpage, causing
a NULL pointer dereference under certain conditions, especially under severe
memory pressure. This patch reimplements do_unionfs_readpage using
vfs_read, which makes the code simpler and more reliable, as we depend on
the VFS to do most of the hard work (even if this implementation might be a
bit slower).
This fix also makes sense because it makes the mmap code in unionfs more
symmetric with unionfs_commit_write --- which uses vfs_write().
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 13 Jul 2007 06:40:31 +0000 (02:40 -0400)]
Unionfs: fix minor typo in a comment
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Wed, 11 Jul 2007 20:13:07 +0000 (16:13 -0400)]
Unionfs: use the splice_read file method instead of sendfile
In 2.6.23 (prior to rc1), sendfile was obsoleted in favor of splice_read.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Tue, 10 Jul 2007 00:19:08 +0000 (20:19 -0400)]
unionfs: better handling when copying up permissions
When we copyup a file, directory, or symlink, we may be copying up from one
file system type to another. The destination file system may not support
all of the features of the source file system, and the differences in
support may be minor. For example jffs2 doesn't allow one to chmod a
symlink (and it returns a -EOPNOTSUPP). So we ignore such harmless errors,
rather than propagating them up, which results in copyup errors and errors
returned back to users.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Tue, 10 Jul 2007 00:14:41 +0000 (20:14 -0400)]
Unionfs: better error handling in rename code when copyups are involved
First, rewrite code slightly and document it better to explain why we appear
to ignore copyup errors (because we try the next branch to the left).
Second, change a BUG_ON to a printk(KERN_ERR), because a mild failure to
copyup a file should not cause an oops. For example, some file systems
don't support UIDs/GIDs (e.g., VFAT) and others don't allow you to chmod a
symlink (e.g., jffs2), possibly resulting in mild copyup failures; that
shouldn't be considered so severe as to cause an oops.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 8 Jul 2007 01:31:28 +0000 (21:31 -0400)]
Unionfs: bugfix when renaming symlinks on readonly branches
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Tue, 3 Jul 2007 13:14:39 +0000 (09:14 -0400)]
Unionfs: prevent deadlock with branch-management code.
Don't grab the superblock read-lock in unionfs_permission, which prevents a
deadlock with the branch-management "add branch" code (which grabbed the
write lock). It is safe to not grab the read lock here, because even with
branch management taking place, there is no chance that unionfs_permission,
or anything it calls, will use stale branch information.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 29 Jun 2007 06:33:14 +0000 (02:33 -0400)]
Unionfs: rename file->f_dentry references to file->f_path.dentry
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 29 Jun 2007 06:02:42 +0000 (02:02 -0400)]
Unionfs: improved comment above unionfs_follow_link
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 29 Jun 2007 06:00:24 +0000 (02:00 -0400)]
Unionfs: Change the semantics of sb info's rwsem
This rw semaphore is used to make sure that a branch management
operation...
1) will not begin before all currently in-flight operations complete
2) any new operations do not execute until the currently running branch
management operation completes
Reworked the patch a bit, added comments, and fixed some bugs, from the
version originally committed into the master branch.
TODO: rename the functions unionfs_{read,write}_{,un}lock() to something
more descriptive.
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 29 Jun 2007 04:45:47 +0000 (00:45 -0400)]
Unionfs: Remove superfluous check for NULL pointer
Since we use containers and the struct inode is _inside_ the
unionfs_inode_info structure, UNIONFS_I will always (given a non-NULL inode
pointer), return a valid non-NULL pointer.
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Conflicts:
fs/unionfs/super.c
Josef 'Jeff' Sipek [Fri, 8 Jun 2007 14:58:22 +0000 (10:58 -0400)]
Unionfs: Change free_dentry_private_info to take a struct dentry
This makes it more symmetric with new_dentry_private_info.
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Erez_Zadok [Fri, 29 Jun 2007 04:36:08 +0000 (00:36 -0400)]
Unionfs: Cleanup new_dentry_private_data
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Conflicts:
fs/unionfs/lookup.c
Erez_Zadok [Mon, 18 Jun 2007 02:39:38 +0000 (22:39 -0400)]
Unionfs: document cache-coherency design and implementation
Document our cache-coherency design, implementation; also mention alternate
designs and a couple of limitations which might be overcome by special
kernel support at the VFS/MM levels. Now that cache-coherency is working,
remove the now-obsolete older discussion of temporary workarounds.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Mon, 18 Jun 2007 02:39:05 +0000 (22:39 -0400)]
Unionfs: cache-coherency calls to maintain the time invariants
This patch represents several types of related changes. First, we invoke
functions to synchronize the upper and lower times as and when needed. Many
of these were bug fixes which were discovered during the development of the
cache-coherency code. That is, Unionfs itself wasn't maintaining
appropriate
times in some places, which if not fixed would have been detected by the
invariant-checking code as a false positive (incorrectly considered as if a
user modified the lower objects directly).
Second, we do not call invariant-validation functions (unionfs_check_file,
unionfs_check_dentry, etc.) until *after* we've revalidated them. Otherwise
we produced false positives.
Third, we pass a flag "willwrite" to __unionfs_d_revalidate_chain to tell it
to purge data pages if the inode lower times appear to be newer.
See Documentation/filesystems/unionfs/concepts.txt under the "Cache
Coherency" section for more details of this design and implementation.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Mon, 18 Jun 2007 02:37:54 +0000 (22:37 -0400)]
Unionfs: core cache-coherency code
This represents the core of the cache-coherency code, the code which
maintains time-based invariants; the lower objects should never be newer
than the upper Unionfs objects. If they are newer, then it means that a
user has modified the lower Unionfs branches directly. If so, then we have
to revalidate our objects by rebuilding them, and possibly discard any stale
data or meta-data. See Documentation/filesystems/unionfs/concepts.txt under
the "Cache Coherency" section for more details of this design and
implementation.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Mon, 18 Jun 2007 02:36:55 +0000 (22:36 -0400)]
Unionfs: introduce two functions to maintain time invariants
A new function unionfs_copy_attr_times to maintain the inode time invariants
as per the Unionfs design (i.e., lower times should never be newer than our
times), as documented in Documentation/filesystems/unionfs/concepts.txt.
The second function, unionfs_copy_attr_all, is the unionfs-specific function
to copy all attributes: it uses the special Unionfs handling of hard-links
(via unionfs_get_nlinks) and it uses the special a/c/mtime handling (via
unionfs_copy_attr_times). This second function is the special
fanout-version of fsstack_copy_attr_all, which was simplified for
linear-stack stackable file systems.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Mon, 18 Jun 2007 02:36:03 +0000 (22:36 -0400)]
Unionfs: prototype and location change for unionfs_get_nlinks
Change prototype of unionfs_get_nlinks to take a const inode. Also move
extern for unionfs_get_nlinks so it can be refereed to in other Unionfs
header files.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Mon, 18 Jun 2007 02:33:56 +0000 (22:33 -0400)]
Unionfs: m/c/atime invariant checking debugging code
Add checks to verify that lower inode times are not newer than our own inode
times. Introduce two useful utility debugging functions to print inode
times.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Mon, 18 Jun 2007 02:29:40 +0000 (22:29 -0400)]
Unionfs: bugfix in debugging infrastructure
Off-by-one bug fixed in range checking for lower directories.
Ensure that we PRINT_CALLER before an additional debug message.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Mon, 11 Jun 2007 16:48:29 +0000 (12:48 -0400)]
Cache coherency: resync unionfs data/meta-data when lower files change
Whenever we revalidate a file or dentry, we check to see if any of the lower
inodes have changed (new mtime/ctime). If so, we revalidate the upper
unionfs objects. This method "works" in that as long as a user process will
have caused unionfs to be called, directly or indirectly, even to just do
->d_revalidate, then we will have purged the current unionfs data and the
process will see the new data. For example, a process that continually
re-reads the same file's data will see the NEW data as soon as the lower
file had changed, upon the next read(2) syscall. This also works for
meta-data changes which change the ctime (chmod, chown, chgrp, etc).
However, this doesn't work when the process re-reads the file's data via
mmap and the data was already read before via mmap: once we respond to
->readpage(s), then the kernel maps the page into the process's address
space and there doesn't appear to be a way to force the kernel to invalidate
those pages/mappings, and force the process to re-issue ->readpage. Note:
only pages that have already been readpage'ed are not updated; any other
pages which unionfs's ->readpage would be called on, WILL get the updated
data. If there's a way to invalidate active mappings and force a
->readpage, let us know please (invalidate_inode_pages2 doesn't do the
trick).
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Mon, 11 Jun 2007 14:52:21 +0000 (10:52 -0400)]
revert changes to new_dentry_private_data and document it
Revert bad changes to this function, but this time explain better its precise
semantics. It can take a dentry whose private unionfs 'info' node exists or
not, and it should allocate and un/lock it only if it's NULL.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 10 Jun 2007 23:04:30 +0000 (19:04 -0400)]
cleanup: convert all instances of "hidden" to "lower".
The unionfs code contained many references to symbols whose name had the
string "hidden" in it, referring to, for example, a "hidden inode" below the
unionfs inode. The term "hidden" was there for historical reasons and was a
misnomer, implying that the objects at unionfs's lower branches were somehow
hidden or unavailable. This was not just incorrect, but confusing. The
lower objects are just that: lower. They are not hidden from users. In
fact, users can 'cd' to lower branches and manipulate files directly there.
This long patch renames all such mis-named symbols, and re-indents the code
as needed to comply with coding standards.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 10 Jun 2007 21:55:23 +0000 (17:55 -0400)]
Fix section marker in header file:
WARNING: fs/unionfs/unionfs.o(.init.text+0x56): Section mismatch: reference to .exit.text:stop_sioq (between 'init_module' and 'init_sioq')
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 10 Jun 2007 21:51:42 +0000 (17:51 -0400)]
minor indentation correction
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Wed, 6 Jun 2007 05:20:15 +0000 (01:20 -0400)]
bugfix: add MODULE_LICENSE to mtdsuper module so it loads
This is a temp fix in rc4. Also reported this bug to MTD maintainer.
Erez_Zadok [Wed, 6 Jun 2007 01:58:07 +0000 (21:58 -0400)]
bugfix: properly reset lower inode start/end range
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 3 Jun 2007 06:27:37 +0000 (02:27 -0400)]
cleanup: rewrite new_dentry_private data more simply
Also remove unnecessary variables and statements.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Sun, 3 Jun 2007 06:26:36 +0000 (02:26 -0400)]
bugfix: remove extra superblock rwsem unlock call
This also makes the code more symmetric: the same code which locks also
unlocks the rwsem.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 1 Jun 2007 04:47:20 +0000 (00:47 -0400)]
remove unnecessary comment
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 1 Jun 2007 04:01:03 +0000 (00:01 -0400)]
properly format a multi line comment
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 1 Jun 2007 03:34:59 +0000 (23:34 -0400)]
reformat all lines longer than 80 characters
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 1 Jun 2007 03:13:14 +0000 (23:13 -0400)]
debugging: indent code properly and cleanups
Also make PRINT_CALLER look like a function.
Fix one small bug in __show_branch_counts.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Fri, 1 Jun 2007 02:32:10 +0000 (22:32 -0400)]
cleanup: reformat all lines longer than 80 characters
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Thu, 31 May 2007 19:53:28 +0000 (15:53 -0400)]
spell check all strings and comments
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Thu, 31 May 2007 19:30:55 +0000 (15:30 -0400)]
cleanup: ensure proper comment on every "#endif"
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Thu, 31 May 2007 03:34:23 +0000 (23:34 -0400)]
Revert "Unionfs: Cleanup locking in new_dentry_private_data"
This reverts commit
ad2d6a5f5e0501ecf704bf2c748e9818ee8e019b.
Conflicts:
fs/unionfs/lookup.c
Erez_Zadok [Thu, 31 May 2007 00:14:07 +0000 (20:14 -0400)]
bugfix: ensure dentry/inode/mnt validity after a successful ioctl
We call unionfs_partial_lookup in our queryfile ioctl method, so we can find
all instances of a lower object to report back to a suer. This can violate
the fanout invariants (e.g., a regular file should have only one lower
object active at a time). So we have to re-establish the invariants on the
lower dentries, inodes, and mnts.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Thu, 31 May 2007 00:09:07 +0000 (20:09 -0400)]
bugfix: release superblock lock at end of ioctl method
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Wed, 30 May 2007 05:02:20 +0000 (01:02 -0400)]
bug fixes: revalidate dentries passed to all inode/super operations
Be sure to properly revalidate all dentry chains passed to all inode and
super_block operations. Remove the older BUG_ON test is_valid_dentry().
This should help improve cache-coherency.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Wed, 30 May 2007 02:09:59 +0000 (22:09 -0400)]
code consistency: ensure that every #endif has a matching comment
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Tue, 29 May 2007 03:24:58 +0000 (23:24 -0400)]
invariants: don't complain if no lower dentry of a deleted dentry
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Mon, 28 May 2007 23:47:35 +0000 (19:47 -0400)]
invariants: don't complain about directories with some NULL lower objects
Directories can have NULL lower objects in between start/end, but NOT if at
the start/end range. We cannot verify that this dentry is a type=DIR,
because it may already be a negative dentry. But if dbstart is greater than
dbend, we know that this couldn't have been a regular file: it had to have
been a directory. In that case, don't complain about NULL lower objects in
in between start/end.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Erez_Zadok [Mon, 28 May 2007 23:45:45 +0000 (19:45 -0400)]
Revert "invariants: don't complain about directories with some NULL lower objects"
This reverts commit
9d8ee83d478be30faf351af7628066ec6658efb5.
Erez_Zadok [Mon, 28 May 2007 23:42:20 +0000 (19:42 -0400)]
invariants: don't complain about directories with some NULL lower objects
Directories can have NULL lower objects in between start/end, but NOT if at
the start/end range. We cannot verify that this dentry is a type=DIR,
because it may already be a negative dentry. But if dbstart is greater than
dbend, we know that this couldn't have been a regular file: it had to have
been a directory. In that case, don't complain about NULL lower objects in
in between start/end.
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>