unionfs-odf.git
17 years agomore (forgotten) cleanups to partial_lookup.
Erez_Zadok [Tue, 29 May 2007 01:15:43 +0000 (21:15 -0400)]
more (forgotten) cleanups to partial_lookup.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
17 years agoinvariants: don't complain about directories with some NULL lower objects
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>
17 years agodocumentation: update of last modification date to odf.txt document
Erez_Zadok [Tue, 29 May 2007 00:50:52 +0000 (20:50 -0400)]
documentation: update of last modification date to odf.txt document

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
17 years agocleanup: rewrite unionfs_partial_lookup more cleanly
Erez_Zadok [Tue, 29 May 2007 00:49:51 +0000 (20:49 -0400)]
cleanup: rewrite unionfs_partial_lookup more cleanly

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
17 years agobug fix: prevent null mntget warning messages in unionfs_lookup_backend
Erez_Zadok [Mon, 28 May 2007 23:38:14 +0000 (19:38 -0400)]
bug fix: prevent null mntget warning messages in unionfs_lookup_backend

Don't try to mntget a lower mnt at a point where the lower mnts don't yet
exist (the callers will have them later on).  Instead, get the lower mnt of
the sb->s_root.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
17 years agodocumentation: expand comments to unionfs_lookup_backend
Erez_Zadok [Tue, 29 May 2007 00:08:20 +0000 (20:08 -0400)]
documentation: expand comments to unionfs_lookup_backend

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Conflicts:

fs/unionfs/lookup.c

17 years agocleanup: remove unnecessary call to inherit_mnt
Erez_Zadok [Mon, 28 May 2007 23:23:42 +0000 (19:23 -0400)]
cleanup: remove unnecessary call to inherit_mnt

Our unionfs_lookup doesn't need to call inherit_mnt: the lower mnts will be
correct here (but not if other methods such as unionfs_rename call our
lookup_backend helper function directly).

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
17 years agobug fix: don't warn if trying to mntput a "negative" union object
Erez_Zadok [Mon, 28 May 2007 23:21:21 +0000 (19:21 -0400)]
bug fix: don't warn if trying to mntput a "negative" union object

In unionfs_d_release, we may get negative dentries which don't have a lower
mnt.  In that case, don't print a warning message from unionfs_mntput about
trying to put a NULL mnt.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
17 years agobug fix: get lower mnt from root dentry instead of lower dentry
Erez_Zadok [Mon, 28 May 2007 23:18:45 +0000 (19:18 -0400)]
bug fix: get lower mnt from root dentry instead of lower dentry

While copying-up a file, the union object hasn't been fully formed yet, so
we don't have all the lower dentries/mnts to use (the caller will have them
later on).  Therefore, we should use the sb->s_root's lower mnt here.  This
fixes a "NULL mnt" warning message that came from unionfs_mntget.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
17 years agocoding-style: removed space before ')'
Yiannis Pericleous [Mon, 28 May 2007 15:53:46 +0000 (11:53 -0400)]
coding-style: removed space before ')'

17 years agocomment on why we cannot create entries in the odf (assign inode nums)
Yiannis Pericleous [Mon, 28 May 2007 15:50:18 +0000 (11:50 -0400)]
comment on why we cannot create entries in the odf (assign inode nums)

when creating the odf cached dir

17 years agoone more comment on the odf_lookup code
Yiannis Pericleous [Mon, 28 May 2007 15:44:08 +0000 (11:44 -0400)]
one more comment on the odf_lookup code

17 years agocomments for odf_lookup functions
Yiannis Pericleous [Mon, 28 May 2007 02:37:17 +0000 (22:37 -0400)]
comments for odf_lookup functions

17 years agoremoved ODF_LOOKUP_LINK flag and moved ODF_RMV_WH to the top of the flags
Yiannis Pericleous [Mon, 28 May 2007 01:53:17 +0000 (21:53 -0400)]
removed ODF_LOOKUP_LINK flag and moved ODF_RMV_WH to the top of the flags

17 years agochanged odf lookup flags values to hex and removed ODF_LOOKUP_LOCKED
Yiannis Pericleous [Mon, 28 May 2007 01:33:54 +0000 (21:33 -0400)]
changed odf lookup flags values to hex and removed ODF_LOOKUP_LOCKED

17 years agochanged unionfs_dentry_info to contain an odf_dentry_info instead of a pointer to one
Yiannis Pericleous [Sat, 26 May 2007 03:50:10 +0000 (23:50 -0400)]
changed unionfs_dentry_info to contain an odf_dentry_info instead of a pointer to one

17 years agomodified odf_lookup functions to return a dentry instead of an
Yiannis Pericleous [Sat, 26 May 2007 02:50:15 +0000 (22:50 -0400)]
modified odf_lookup functions to return a dentry instead of an

odf_dentry_info

17 years agoUnionfs: allow users to override Makefile options in fs/unionfs/local.mk
Erez_Zadok [Sat, 26 May 2007 02:36:13 +0000 (22:36 -0400)]
Unionfs: allow users to override Makefile options in fs/unionfs/local.mk

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
17 years agoremove trailing ':' when building dirs= options from odf sb file
Yiannis Pericleous [Fri, 25 May 2007 21:29:23 +0000 (17:29 -0400)]
remove trailing ':' when building dirs= options from odf sb file

17 years agoremoved warning when branch_id_to_idx fails to match requested id, and added a
Yiannis Pericleous [Fri, 25 May 2007 21:20:54 +0000 (17:20 -0400)]
removed warning when branch_id_to_idx fails to match requested id, and added a

comment for why this can be legal in the odf

17 years agobug fix: catch bad use of dirs= options (extra ':' separators)
Erez_Zadok [Fri, 25 May 2007 21:01:00 +0000 (17:01 -0400)]
bug fix: catch bad use of dirs= options (extra ':' separators)

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
17 years agounionfs: merge find_new_branch_index and branch_id_to_idx into one function
Erez_Zadok [Fri, 25 May 2007 20:36:08 +0000 (16:36 -0400)]
unionfs: merge find_new_branch_index and branch_id_to_idx into one function

Useful code cleanup and consolidation between the ODF code and non-ODF code.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Conflicts:

fs/unionfs/commonfops.c
fs/unionfs/fanout.h

17 years agodont put ic dentry in odf_get_ic_dentry
Yiannis Pericleous [Fri, 25 May 2007 20:25:31 +0000 (16:25 -0400)]
dont put ic dentry in odf_get_ic_dentry

17 years agomodified odf_ic_cache_dentry not to use odf_lookup and to return a dentry instead of
Yiannis Pericleous [Fri, 25 May 2007 19:53:32 +0000 (15:53 -0400)]
modified odf_ic_cache_dentry not to use odf_lookup and to return a dentry instead of

an odf_dentry_info

17 years agounionfs: minor cleanup and better commenting in new_dentry_private_data
Erez_Zadok [Fri, 25 May 2007 19:51:33 +0000 (15:51 -0400)]
unionfs: minor cleanup and better commenting in new_dentry_private_data

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Conflicts:

fs/unionfs/lookup.c

17 years agoUnionfs: Cleanup locking in new_dentry_private_data
Erez_Zadok [Fri, 25 May 2007 19:45:30 +0000 (15:45 -0400)]
Unionfs: Cleanup locking in new_dentry_private_data

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Conflicts:

fs/unionfs/lookup.c

17 years agobugfix: prevent null-deref oops if lower f/s is NFS (mmap writes)
Erez_Zadok [Fri, 25 May 2007 19:37:38 +0000 (15:37 -0400)]
bugfix: prevent null-deref oops if lower f/s is NFS (mmap writes)

This is a workaround fora deficiency of the linux MM layer, which doesn't
allow clean coordination between upper and lower pages in stackable layers.
We prevent an oops, but the cost is that we're not able to implement
writepages cleanly, not can we call the lower file system's writepages.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
17 years agochanged unionfs_sb_info to contain a unionfs_sb_info instead of a pointer to one
Yiannis Pericleous [Fri, 25 May 2007 18:55:35 +0000 (14:55 -0400)]
changed unionfs_sb_info to contain a unionfs_sb_info instead of a pointer to one

17 years agoremoved the odf_sb_info field from the odf_dentry_info struct
Yiannis Pericleous [Fri, 25 May 2007 18:23:21 +0000 (14:23 -0400)]
removed the odf_sb_info field from the odf_dentry_info struct

17 years agoremoved the inum field from odf_dentry_info struct
Yiannis Pericleous [Fri, 25 May 2007 18:16:08 +0000 (14:16 -0400)]
removed the inum field from odf_dentry_info struct

17 years agochanged the odf_sb_info structure to hold dentry pointers to the odf special dirs
Yiannis Pericleous [Fri, 25 May 2007 17:38:39 +0000 (13:38 -0400)]
changed the odf_sb_info structure to hold dentry pointers to the odf special dirs

instead of odf_dentry_info pointers

17 years agoremoved odf locks, added LOCK comments where we might still want to
Yiannis Pericleous [Fri, 25 May 2007 16:41:48 +0000 (12:41 -0400)]
removed odf locks, added LOCK comments where we might still want to

lock something, ie when operating in odf/ic /sr and /reclaim

17 years agocleaner odf_is_new function
Yiannis Pericleous [Fri, 25 May 2007 04:02:12 +0000 (00:02 -0400)]
cleaner odf_is_new function

17 years agoproper capitalization of unionfs
Yiannis Pericleous [Fri, 25 May 2007 03:59:25 +0000 (23:59 -0400)]
proper capitalization of unionfs

17 years agouse sizeof() instead of strlen
Yiannis Pericleous [Fri, 25 May 2007 03:57:08 +0000 (23:57 -0400)]
use sizeof() instead of strlen

17 years agoprint KERN_ERR is odf_read_super fails
Yiannis Pericleous [Fri, 25 May 2007 03:53:25 +0000 (23:53 -0400)]
print KERN_ERR is odf_read_super fails

17 years agoremove the BUG_ON in odf_is_wh, for now because odf lookup is
Yiannis Pericleous [Fri, 25 May 2007 03:46:06 +0000 (23:46 -0400)]
remove the BUG_ON in odf_is_wh, for now because odf lookup is

called in odf_put_super before the whiteout file is created.

17 years agouse LOOKUP_DIRECTORY instead of LOOKUP_FOLLOW
Yiannis Pericleous [Fri, 25 May 2007 03:43:23 +0000 (23:43 -0400)]
use LOOKUP_DIRECTORY instead of LOOKUP_FOLLOW

17 years agoreturn EEXIST if a dir exists when constructing the odf hierarchy
Yiannis Pericleous [Fri, 25 May 2007 03:36:21 +0000 (23:36 -0400)]
return EEXIST if a dir exists when constructing the odf hierarchy

17 years agoremoved unused function
Yiannis Pericleous [Fri, 25 May 2007 03:31:48 +0000 (23:31 -0400)]
removed unused function

17 years agoadded comments for odf special filenames constants and grouped them together
Yiannis Pericleous [Fri, 25 May 2007 03:24:55 +0000 (23:24 -0400)]
added comments for odf special filenames constants and grouped them together

17 years agouse only one version number for odf.
Yiannis Pericleous [Fri, 25 May 2007 03:10:31 +0000 (23:10 -0400)]
use only one version number for odf.

set version number to 2, since format has changed
since last release

17 years agocleanup: removed unneeded declarations
Yiannis Pericleous [Fri, 25 May 2007 02:46:45 +0000 (22:46 -0400)]
cleanup: removed unneeded declarations

17 years agocoding style: use branch_id function instead of accessing sb private
Yiannis Pericleous [Fri, 25 May 2007 02:41:47 +0000 (22:41 -0400)]
coding style: use branch_id function instead of accessing sb private

data directly

17 years agoadded BUG_ON to make sure dentry passed to get_parent is a dir
Yiannis Pericleous [Fri, 25 May 2007 02:32:59 +0000 (22:32 -0400)]
added BUG_ON to make sure dentry passed to get_parent is a dir

17 years agoremoved unnecessary call to unreg_configfs if init fails
Yiannis Pericleous [Fri, 25 May 2007 02:18:51 +0000 (22:18 -0400)]
removed unnecessary call to unreg_configfs if init fails

17 years agocoding style: align function arguments
Yiannis Pericleous [Fri, 25 May 2007 02:14:38 +0000 (22:14 -0400)]
coding style: align function arguments

17 years agocoding style: use switch statement to avoid ugly if/else nesting
Yiannis Pericleous [Fri, 25 May 2007 02:12:13 +0000 (22:12 -0400)]
coding style: use switch statement to avoid ugly if/else nesting

17 years agocoding style: use void in a function taking no args
Yiannis Pericleous [Fri, 25 May 2007 02:00:31 +0000 (22:00 -0400)]
coding style: use void in a function taking no args

17 years agosmall fix: initialize 'res' to 0 to avoid gcc warning
Erez_Zadok [Thu, 24 May 2007 04:20:42 +0000 (00:20 -0400)]
small fix: initialize 'res' to 0 to avoid gcc warning

17 years agocleanup: use krealloc instead of open-coding it with kmalloc/kfree/memcpy
Erez_Zadok [Thu, 24 May 2007 04:20:04 +0000 (00:20 -0400)]
cleanup: use krealloc instead of open-coding it with kmalloc/kfree/memcpy

Conflicts:

fs/unionfs/lookup.c

17 years agobugfix: prevent a NULL ptr deref if branch is nfs and using mmap writes
Erez_Zadok [Thu, 24 May 2007 01:27:58 +0000 (21:27 -0400)]
bugfix: prevent a NULL ptr deref if branch is nfs and using mmap writes

By some strange condition, the VFS can pass our unionfs_writepage a
writeback_control structure which, if passed as is to the lower ->writepage
-- here nfs_writepage, triggers a NULL ptr deref in NFS.  This fix works
around this issue, and results in a successfully written mmaped file.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
17 years agobugfix: handle lower file systems that do not support writeable mappings
Erez_Zadok [Thu, 24 May 2007 01:26:01 +0000 (21:26 -0400)]
bugfix: handle lower file systems that do not support writeable mappings

File systems such as jffs2 (tested in 2.6.22-rc22) do not have a
->writepage.  Make sure unionfs detects that conditions and returns EINVAL
when a user tries to mmap such a file with VM_WRITE.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
17 years agocleanup thread to clean odf/sr as well on mount if odfforce is not set
Yiannis Pericleous [Wed, 23 May 2007 22:53:56 +0000 (18:53 -0400)]
cleanup thread to clean odf/sr as well on mount if odfforce is not set

17 years agoset gid/uid to 0 in ofd_release_sr
Yiannis Pericleous [Wed, 23 May 2007 22:43:40 +0000 (18:43 -0400)]
set gid/uid to 0 in ofd_release_sr

17 years agocleanup: removed unnecesary braces
Yiannis Pericleous [Wed, 23 May 2007 22:36:19 +0000 (18:36 -0400)]
cleanup: removed unnecesary braces

17 years agomoved call of odf_release_sr from drop_inode to clear_inode
Yiannis Pericleous [Wed, 23 May 2007 22:12:11 +0000 (18:12 -0400)]
moved call of odf_release_sr from drop_inode to clear_inode

17 years agoadded undeclared variables to unionfs_remount
Yiannis Pericleous [Wed, 23 May 2007 14:46:07 +0000 (10:46 -0400)]
added undeclared variables to unionfs_remount

17 years agobug fix: set lower inodes correctly after branch management succeeds
Erez Zadok [Wed, 23 May 2007 04:03:59 +0000 (00:03 -0400)]
bug fix: set lower inodes correctly after branch management succeeds

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Conflicts:

fs/unionfs/super.c

17 years agobug fix: prevent self deadlock with remount code in pivot_root scenarios
Erez Zadok [Wed, 23 May 2007 03:50:44 +0000 (23:50 -0400)]
bug fix: prevent self deadlock with remount code in pivot_root scenarios

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
17 years agodebugging: test for freed (0x5a) inodes
Erez Zadok [Wed, 23 May 2007 03:49:35 +0000 (23:49 -0400)]
debugging: test for freed (0x5a) inodes

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
17 years agobugfix: statfs lower file system properly
Erez Zadok [Wed, 23 May 2007 04:01:46 +0000 (00:01 -0400)]
bugfix: statfs lower file system properly

Get the correct lower dentry to use to statfs the first branch (always), now
works with disk-based as well as network file systems.  Also document the
code better.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Conflicts:

fs/unionfs/super.c

17 years agoAdd Erez Zadok to maintainers list
Erez_Zadok [Sun, 20 May 2007 01:11:22 +0000 (21:11 -0400)]
Add Erez Zadok to maintainers list

17 years agoadd standard copyright comment to linux/union_fs.h
Erez_Zadok [Sun, 20 May 2007 01:07:29 +0000 (21:07 -0400)]
add standard copyright comment to linux/union_fs.h

17 years agoreaddir bug: must pass the file position at the start of the dirent to filldir
Yiannis Pericleous [Tue, 22 May 2007 22:27:39 +0000 (18:27 -0400)]
readdir bug: must pass the file position at the start of the dirent to filldir

17 years agodocumentation: added info about /odf/sr in odf.txt
Yiannis Pericleous [Tue, 22 May 2007 22:05:05 +0000 (18:05 -0400)]
documentation: added info about /odf/sr in odf.txt

17 years agowhen an inode is dropped, check if it has an entry in /odf/sr and move it to /odf...
Yiannis Pericleous [Tue, 22 May 2007 21:51:30 +0000 (17:51 -0400)]
when an inode is dropped, check if it has an entry in /odf/sr and move it to /odf/reclaim

17 years agosilly rename (move to /odf/sr) files to be removed that have i_count > 1
Yiannis Pericleous [Tue, 22 May 2007 20:32:40 +0000 (16:32 -0400)]
silly rename (move to /odf/sr) files to be removed that have i_count > 1

17 years agoadded odf/sr to odf structure, that will contain odf silly renamed files
Yiannis Pericleous [Tue, 22 May 2007 20:14:45 +0000 (16:14 -0400)]
added odf/sr to odf structure, that will contain odf silly renamed files

17 years agorename bug:
Yiannis Pericleous [Tue, 22 May 2007 20:08:01 +0000 (16:08 -0400)]
rename bug:

if the dst dentry exists at the start of the rename, then at the end
we need to purge its inode's lower inode pointers if it is not used
by anyone else, since it might remain in the cache and the odf might
give this inode number to a new inode, resulting in the new inode
having the old inode's pointers.

17 years agorename bug: return EXDEV when destinations parent is opaque at a branch to the left of
Yiannis Pericleous [Tue, 22 May 2007 19:27:52 +0000 (15:27 -0400)]
rename bug: return EXDEV when destinations parent is opaque at a branch to the left of

source's start branch

17 years agolink and rename invariants when new_dentry is negative and link/rename happens on
Yiannis Pericleous [Tue, 22 May 2007 16:33:10 +0000 (12:33 -0400)]
link and rename invariants when new_dentry is negative and link/rename happens on

a branch other than leftmost

17 years agosmaller odf cached dir dirents, and also rearranged dirent contents
Yiannis Pericleous [Sun, 20 May 2007 22:59:13 +0000 (18:59 -0400)]
smaller odf cached dir dirents, and also rearranged dirent contents

to more closely resemble the ext2 dirent structure

17 years agolooukup bug: moved check if nameidata is null before check for odf whiteout
Yiannis Pericleous [Sun, 20 May 2007 22:43:18 +0000 (18:43 -0400)]
looukup bug: moved check if nameidata is null before check for odf whiteout

17 years agoreaddir bug, set fpos back to previous dirent if buffer overflows
Yiannis Pericleous [Sun, 20 May 2007 20:59:15 +0000 (16:59 -0400)]
readdir bug, set fpos back to previous dirent if buffer overflows

17 years agofixed opaque dirs invariancy issue
Yiannis Pericleous [Sun, 20 May 2007 19:29:37 +0000 (15:29 -0400)]
fixed opaque dirs invariancy issue

17 years agoremoved unneeded inodeinfo that got left over from last cherry-pick
Yiannis Pericleous [Sun, 20 May 2007 19:25:19 +0000 (15:25 -0400)]
removed unneeded inodeinfo that got left over from last cherry-pick

17 years agommap: file revalidation and fanout invariant validation
Yiannis Pericleous [Sun, 20 May 2007 18:54:57 +0000 (14:54 -0400)]
mmap: file revalidation and fanout invariant validation

Added the newer checks to file revalidation and fanout invariants to the
newly merged mmap code.  Also minor mmap related comments added.

Conflicts:

fs/unionfs/commonfops.c
fs/unionfs/file.c

17 years agoapplied ezk changes to d_splice fix so both branches are synced
Yiannis Pericleous [Sun, 20 May 2007 18:49:22 +0000 (14:49 -0400)]
applied ezk changes to d_splice fix so both branches are synced

17 years agorename invariant issues fix
Yiannis Pericleous [Sun, 20 May 2007 18:44:45 +0000 (14:44 -0400)]
rename invariant issues fix

17 years agodocumentaion: say in odf.txt where file came from
Erez_Zadok [Sun, 20 May 2007 03:57:46 +0000 (23:57 -0400)]
documentaion: say in odf.txt where file came from

17 years agodebug: left out a line from the previous fix
Yiannis Pericleous [Sat, 19 May 2007 22:35:21 +0000 (18:35 -0400)]
debug: left out a line from the previous fix

17 years agodebug: remove unnecessarily verbose debugging printk's
Yiannis Pericleous [Sat, 19 May 2007 22:30:03 +0000 (18:30 -0400)]
debug: remove unnecessarily verbose debugging printk's

17 years agocleanup: consistent printk messages
Yiannis Pericleous [Sat, 19 May 2007 22:27:47 +0000 (18:27 -0400)]
cleanup: consistent printk messages

17 years agobugfix: check if dentry is returned by lookup_backend
Yiannis Pericleous [Sat, 19 May 2007 22:25:39 +0000 (18:25 -0400)]
bugfix: check if dentry is returned by lookup_backend

17 years agofixed some minor issues after applying erez's patches
Yiannis Pericleous [Sat, 19 May 2007 21:15:54 +0000 (17:15 -0400)]
fixed some minor issues after applying erez's patches

17 years agowhitespace cleanup
Yiannis Pericleous [Sat, 19 May 2007 21:04:49 +0000 (17:04 -0400)]
whitespace cleanup

17 years agocleanup: eliminate wrapper function create_parents
Yiannis Pericleous [Sat, 19 May 2007 21:03:20 +0000 (17:03 -0400)]
cleanup: eliminate wrapper function create_parents

Eliminate simple wrapper function create_parents which trivially called
create_parents_named with one more arg derived from the caller.  Instead,
remove the wrapper, rename create_parents_named to create_parents, and make
everyone call create_parents directly.  This clarifies the code a bit more
and saves a bit on stack space.

Conflicts:

fs/unionfs/inode.c
fs/unionfs/subr.c

17 years agocleanup: eliminate wrapper function copyup_dentry
Yiannis Pericleous [Sat, 19 May 2007 20:52:03 +0000 (16:52 -0400)]
cleanup: eliminate wrapper function copyup_dentry

Eliminate simple wrapper function copyup_dentry which trivially called
copyup_named_dentry with 2 more args derived from the caller.  Instead,
remove the wrapper, rename copyup_named_dentry to copyup_dentry, and make
everyone call copyup_dentry directly.  This clarifies the code a bit more
and saves a bit on stack space.

Conflicts:

fs/unionfs/inode.c
fs/unionfs/rename.c

17 years agocleanup: rewrite do_delayed_copyup more cleanly and clearly
Erez Zadok [Fri, 18 May 2007 07:07:37 +0000 (03:07 -0400)]
cleanup: rewrite do_delayed_copyup more cleanly and clearly

17 years agodebugging: small fix to Makefile to correct #define typo
Erez Zadok [Fri, 18 May 2007 06:18:44 +0000 (02:18 -0400)]
debugging: small fix to Makefile to correct #define typo

17 years agocleanup: remove unnecessary macro used in only one place
Erez Zadok [Fri, 18 May 2007 05:56:08 +0000 (01:56 -0400)]
cleanup: remove unnecessary macro used in only one place

Remove the UNIONFS_TMPNAM_LEN macro and just use the actual length of the
string file name in question, which is more efficient (and correct).

17 years agobug fix: don't revalidate dropped dentries
Erez Zadok [Fri, 18 May 2007 05:53:12 +0000 (01:53 -0400)]
bug fix: don't revalidate dropped dentries

This fixes a harmless but annoying message that unionfs prints if a dropped
dentry is being revalidated, which could happen if you unlink open files.

17 years agobug fix: retry lookup for different silly-renamed files
Erez Zadok [Fri, 18 May 2007 05:45:18 +0000 (01:45 -0400)]
bug fix: retry lookup for different silly-renamed files

When we have to copyup an open-but-unlinked file, we have to give it a
temporary name, similar to NFS's silly-renamed files.  So we generate
temporary file names until we find one that doesn't exist, and use it.  The
code had a bug where if the silly-renamed file name already existed, Unionfs
would oops upon copyup to that temp name.

17 years agoDocumentation: better comments for copyup-related code
Erez Zadok [Fri, 18 May 2007 05:41:04 +0000 (01:41 -0400)]
Documentation: better comments for copyup-related code

17 years agoVerify and maintain fanout invariants.
Yiannis Pericleous [Sat, 19 May 2007 20:41:10 +0000 (16:41 -0400)]
Verify and maintain fanout invariants.

This somewhat long patch calls various invariant-checking (debugging)
functions in all places where the fanout invariants should hold.  The three
invariant-checking functions, __unionfs_check_{inode,dentry,file}, perform
exhaustive sanity checking on the fan-out of various Unionfs objects.  We
check that no lower objects exist outside the start/end branch range; that
all objects within are non-NULL (with some allowed exceptions); that for
every lower file there's a lower dentry+inode; that the start/end ranges
match for all corresponding lower objects; that open files/symlinks have
only one lower objects, but directories can have several; and more.

The rest of this patch actually fixes many places where these invariants did
not hold, which could lead to bugs or corruptions under heavy loads,
multi-threaded workloads, dynamic branch-management, and mmap operations.
Most of the bugs related to actions involving copyups and whiteouts.  With
these fixes, the entire Unionfs regression suite passes without a single
invariant violated.

Conflicts:

fs/unionfs/commonfops.c
fs/unionfs/file.c
fs/unionfs/inode.c
fs/unionfs/unlink.c

17 years agoPost-copyup helper functions
Erez Zadok [Fri, 18 May 2007 05:31:14 +0000 (01:31 -0400)]
Post-copyup helper functions

Two functions which are very useful to execute common actions needed after a
copy-up had taken place.

17 years agoIntroduce compile-time debugging support to Unionfs
Yiannis Pericleous [Sat, 19 May 2007 20:27:25 +0000 (16:27 -0400)]
Introduce compile-time debugging support to Unionfs

Similar to other file systems, to turn on debugging, one is asked to change
the Makefile slightly.  The vast majority of the debugging utility functions
are in debug.c.  They are useful for developers and users to report to
developers.  The main code has some very useful hooks left behind that are
non-intrusive and cleaner (i.e., no "ifdef DEBUG" clutter).

Conflicts:

fs/unionfs/union.h

17 years agofixed some rebase conflicts
Yiannis Pericleous [Sat, 19 May 2007 20:16:11 +0000 (16:16 -0400)]
fixed some rebase conflicts

17 years agommap: sync_page bug, call sync_page on lower page, not unionfs page
Yiannis Pericleous [Sat, 19 May 2007 19:23:22 +0000 (15:23 -0400)]
mmap: sync_page bug, call sync_page on lower page, not unionfs page