commit 14f1f6e3d926d22dba34c195e5ee092ed4457e36
Author: Erez Zadok <[EMAIL PROTECTED](none)>
Date: Wed May 23 00:01:46 2007 -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 <[EMAIL PROTECTED]>
Conflicts:
fs/unionfs/super.c
diff --git a/fs/unionfs/super.c b/fs/unionfs/super.c
index e663752..d9704bb 100644
--- a/fs/unionfs/super.c
+++ b/fs/unionfs/super.c
@@ -119,22 +119,30 @@ static void unionfs_put_super(struct super_block *sb)
static int unionfs_statfs(struct dentry *dentry, struct kstatfs *buf)
{
int err = 0;
- struct super_block *sb, *hidden_sb;
+ struct super_block *sb;
+ struct dentry *lower_dentry;
BUG_ON(!is_valid_dentry(dentry));
+ unionfs_check_dentry(dentry);
sb = dentry->d_sb;
unionfs_read_lock(sb);
- hidden_sb = unionfs_lower_super_idx(sb, sbstart(sb));
+ lower_dentry = unionfs_lower_dentry(sb->s_root);
unionfs_read_unlock(sb);
- err = vfs_statfs(hidden_sb->s_root, buf);
+ err = vfs_statfs(lower_dentry, buf);
+ /* set return buf to our f/s to avoid confusing user-level utils */
buf->f_type = UNIONFS_SUPER_MAGIC;
+ /*
+ * reset two fields to avoid confusing user-land.
+ * XXX: is this still necessary?
+ */
memset(&buf->f_fsid, 0, sizeof(__kernel_fsid_t));
memset(&buf->f_spare, 0, sizeof(buf->f_spare));
+ unionfs_check_dentry(dentry);
return err;
}
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs