From: Erez_Zadok Date: Mon, 28 May 2007 23:42:20 +0000 (-0400) Subject: invariants: don't complain about directories with some NULL lower objects X-Git-Tag: unionfs-2.1.1~80 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=e6ac72470200e7470462ed2cbc2d1e32bc3e5249;p=unionfs-2.6.25.y.git 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 --- diff --git a/fs/unionfs/union.h b/fs/unionfs/union.h index bb8d2b85f8c..753eb2ab48e 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; }