Unionfs: bugfix in debugging infrastructure
authorErez_Zadok <ezk@cs.sunysb.edu>
Mon, 18 Jun 2007 02:29:40 +0000 (22:29 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 11 Nov 2014 02:32:04 +0000 (21:32 -0500)
Off-by-one bug fixed in range checking for lower directories.
Ensure that we PRINT_CALLER before an additional debug message.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/debug.c

index 9255ebbe323a13270774e0d57f34fdc1844c7db5..34ef190e7f847b3b5bdde067c83f92119b28de93 100644 (file)
@@ -285,17 +285,19 @@ void __unionfs_check_dentry(const struct dentry *dentry,
         * and inode.
         */
        if (S_ISDIR(inode->i_mode))
-               for (bindex = dstart+1; bindex < dend-1; bindex++) {
+               for (bindex = dstart+1; bindex < dend; bindex++) {
                        lower_inode = unionfs_lower_inode_idx(inode, bindex);
                        lower_dentry = unionfs_lower_dentry_idx(dentry,
                                                                bindex);
                        lower_mnt = unionfs_lower_mnt_idx(dentry, bindex);
                        if (!((lower_inode && lower_dentry && lower_mnt) ||
-                             (!lower_inode && !lower_dentry && !lower_mnt)))
+                             (!lower_inode && !lower_dentry && !lower_mnt))) {
+                               PRINT_CALLER();
                                printk(" Cx: lmnt/ldentry/linode=%p:%p:%p "
                                       "bindex=%d dstart/end=%d:%d\n",
                                       lower_mnt, lower_dentry, lower_inode,
                                       bindex, dstart, dend);
+                       }
                }
 }