GIT: unionfs2-2.6.27.y: invariants: don't complain about directories with some NULL lower objects
Erez Zadok
ezk at fsl.cs.sunysb.edu
Thu Aug 12 23:16:30 EDT 2010
commit feb97b071fd4b506dcbc90016fe0bb1c035d5b44
Author: Erez_Zadok <ezk at cs.sunysb.edu>
Date: Mon May 28 19:42:20 2007 -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 at cs.sunysb.edu>
diff --git a/fs/unionfs/union.h b/fs/unionfs/union.h
index bb8d2b8..753eb2a 100644
--- a/fs/unionfs/union.h
+++ b/fs/unionfs/union.h
@@ -510,9 +510,19 @@ static inline void unionfs_mntput(struct dentry *dentry, int bindex)
return;
if (!mnt && bindex >= 0) {
#ifdef UNIONFS_DEBUG
- printk(KERN_DEBUG
- "unionfs_mntput: mnt=%p bindex=%d\n",
- mnt, bindex);
+ /*
+ * 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.
+ */
+ if (!(bindex > dbstart(dentry) && bindex < dbend(dentry)))
+ printk(KERN_WARNING
+ "unionfs_mntput: mnt=%p bindex=%d (%s:%d)\n",
+ mnt, bindex, fxn, line);
#endif /* UNIONFS_DEBUG */
return;
}
More information about the unionfs-cvs
mailing list