commit efcc16a5b3aebcb678f7c0be511a9dbdbb86baa0
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date: Wed Apr 11 19:52:34 2007 -0400
don't expect a completely empty odf
diff --git a/fs/unionfs/odf.c b/fs/unionfs/odf.c
index 65a75f0..b861f2d 100644
--- a/fs/unionfs/odf.c
+++ b/fs/unionfs/odf.c
@@ -109,50 +109,43 @@ struct odf_sb_info* odf_read_super(char *options)
goto out_release;
}
- /* if this odf is fresh, create the hierarchy */
- if (check_empty_lower(nd.dentry, nd.mnt) == 0) {
- err = __odf_create_hierarchy(nd.dentry);
- if (err)
- goto out_release;
- new = 1;
- }
osi = kzalloc(sizeof(struct odf_sb_info), GFP_KERNEL);
if (!osi) {
err = -ENOMEM;
goto out_release;
}
+ osi->odi_sb = odf_getpath(nd.dentry, osi, ODF_SB);
+ if (IS_ERR(osi->odi_sb)){
+ osi->odi_sb = NULL;
+
+ /* if this odf is fresh, create the hierarchy */
+ err = __odf_create_hierarchy(nd.dentry);
+ if (err)
+ goto out_free;
+ new = 1;
+
+ osi->odi_sb = odf_getpath(nd.dentry, osi, ODF_SB);
+ if (IS_ERR(osi->odi_sb)){
+ err = PTR_ERR(osi->odi_sb);
+ osi->odi_sb = NULL;
+ goto out_free;
+ }
+ }
+
osi->odi_ns = odf_getpath(nd.dentry, osi, ODF_NS);
if (IS_ERR(osi->odi_ns)){
err = PTR_ERR(osi->odi_ns);
osi->odi_ns = NULL;
goto out_free;
}
- if (!osi->odi_ns) {
- err = -EINVAL;
- goto out_free;
- }
- osi->odi_sb = odf_getpath(nd.dentry, osi, ODF_SB);
- if (IS_ERR(osi->odi_sb)){
- err = PTR_ERR(osi->odi_sb);
- osi->odi_sb = NULL;
- goto out_free;
- }
- if (!osi->odi_sb) {
- err = -EINVAL;
- goto out_free;
- }
osi->odi_rc = odf_getpath(nd.dentry, osi, ODF_RC);
if (IS_ERR(osi->odi_rc)){
err = PTR_ERR(osi->odi_rc);
osi->odi_rc = NULL;
goto out_free;
}
- if (!osi->odi_rc) {
- err = -EINVAL;
- goto out_free;
- }
osi->odi_ic = odf_getpath(nd.dentry, osi, ODF_IC);
if (IS_ERR(osi->odi_ic)){
@@ -160,10 +153,6 @@ struct odf_sb_info* odf_read_super(char *options)
osi->odi_ic = NULL;
goto out_free;
}
- if (!osi->odi_ic) {
- err = -EINVAL;
- goto out_free;
- }
osi->whiteout = lookup_one_len(ODF_WH_NAME, osi->odi_sb->dentry,
ODF_WH_LEN);
if (IS_ERR(osi->whiteout)) {
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs