Whamcloud - gitweb
b=22107 a fix for the warning message in filter_destroy_internal
authorAndrew Perepechko <Andrew.Perepechko@Sun.COM>
Thu, 30 Sep 2010 12:32:46 +0000 (16:32 +0400)
committerVitaly Fertman <vitaly.fertman@sun.com>
Mon, 4 Oct 2010 19:58:04 +0000 (23:58 +0400)
filter_destroy_internal is entered with inode references from
lookup and from the resource used by the extent lock, so the
check is changed to i_count != 2.

i=Vitaly Fertman
i=Johann Lombardi

lustre/obdfilter/filter.c

index 6ae7c4f..a498a66 100644 (file)
@@ -1595,7 +1595,10 @@ static int filter_destroy_internal(struct obd_device *obd, obd_id objid,
         struct inode *inode = dchild->d_inode;
         int rc;
 
         struct inode *inode = dchild->d_inode;
         int rc;
 
-        if (inode->i_nlink != 1 || atomic_read(&inode->i_count) != 1) {
+        /* There should be 2 references to the inode:
+         *  1) taken by filter_prepare_destroy
+         *  2) taken by filter_destroy */
+        if (inode->i_nlink != 1 || atomic_read(&inode->i_count) != 2) {
                 CERROR("destroying objid %.*s ino %lu nlink %lu count %d\n",
                        dchild->d_name.len, dchild->d_name.name, inode->i_ino,
                        (unsigned long)inode->i_nlink,
                 CERROR("destroying objid %.*s ino %lu nlink %lu count %d\n",
                        dchild->d_name.len, dchild->d_name.name, inode->i_ino,
                        (unsigned long)inode->i_nlink,