commit c48383f7a64ced8271fdc12ce84c770c0f414ce4
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date:   Sun Mar 25 13:52:14 2007 -0400

    added check for no of odf supported branches at mount time

diff --git a/fs/unionfs/odf.c b/fs/unionfs/odf.c
index a3af320..b266b4e 100644
--- a/fs/unionfs/odf.c
+++ b/fs/unionfs/odf.c
@@ -1854,6 +1854,26 @@ int odf_update_uuids(struct odf_sb_info *odf, struct 
path *old_paths, int old_br
 out:
        return err;
 }
+
+/*
+ * Unsets the newbit
+ */
+void odf_unset_newbit(struct odf_sb_info *osi)
+{
+       struct dentry *newbit;
+
+       /* check the new bit, for now check if file newbit exists */
+       newbit = lookup_one_len(ODF_NEWBIT, osi->odi_sb->dentry, 
strlen(ODF_NEWBIT));
+       if (IS_ERR(newbit) || !newbit)
+               return;
+       else if (unlikely(!newbit->d_inode)) {
+               dput(newbit);
+               return;
+       }
+       vfs_unlink(newbit->d_parent->d_inode, newbit);
+       dput(newbit);
+}
+
 /*
  * Writes the superblock data for new odf's, generates branch UUID's
  * Superblock contains:
@@ -1885,6 +1905,16 @@ int odf_write_sb_data(struct odf_sb_info* osi, struct 
unionfs_data *data, struct
        d_odf_sb = osi->odi_sb->dentry;
        odf_mnt = osi->mnt;
 
+       /* check the number of branches */
+       count = hidden_root->bend - hidden_root->bstart + 1;
+       if (count >= (1 << ODF_OPQ_BITS)) {
+               printk(KERN_WARNING "unionfs: too many branches (%d), "
+                       "odf can only support %d branches\n",
+                       count, (1 << ODF_OPQ_BITS) - 1);
+               err = -EINVAL;
+               goto out;
+       }
+
        d_content = lookup_one_len(ODF_CONTENT, d_odf_sb, ODF_CONTENT_LEN);
        if (IS_ERR(d_content) || !d_content) {
                err = -EINVAL;
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to