Whamcloud - gitweb
Branch:HEAD
authorwangdi <wangdi>
Thu, 19 Apr 2007 10:01:20 +0000 (10:01 +0000)
committerwangdi <wangdi>
Thu, 19 Apr 2007 10:01:20 +0000 (10:01 +0000)
b:12123
Check if a directory has children when invalidating dentries
associated with an inode during lock cancellation.  This fixes
an incorrect ENOENT sometimes seen for valid filehandles during
testing with dbench.
r:green
r:shadow

lustre/ChangeLog
lustre/llite/namei.c

index 8cdc3d7..2f491b7 100644 (file)
@@ -48,6 +48,14 @@ Description: connectathon hang when test nfs export over patchless client
 Details    : Disconnected dentry cannot be found with lookup, so we do not need 
             to unhash it or make it invalid
 
+Severity   : normal
+Bugzilla   : 12123
+Description: ENOENT returned for valid filehandle during dbench.
+Details:   : Check if a directory has children when invalidating dentries
+            associated with an inode during lock cancellation. This fixes
+            an incorrect ENOENT sometimes seen for valid filehandles during
+            testing with dbench.
+
 --------------------------------------------------------------------------------
 
 tbd         Cluster File Systems, Inc. <info@clusterfs.com>
index 93d063d..4bba5d6 100644 (file)
@@ -209,31 +209,29 @@ int ll_mdc_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
                 if (S_ISDIR(inode->i_mode) &&
                      (bits & MDS_INODELOCK_UPDATE)) {
                         struct dentry *dentry, *tmp, *dir;
-                        struct list_head *list;
+                        int alias_counter = 0;
 
                         CDEBUG(D_INODE, "invalidating inode %lu\n",
                                inode->i_ino);
                         truncate_inode_pages(inode->i_mapping, 0);
 
                         /* Drop possible cached negative dentries */
-                        list = &inode->i_dentry;
                         dir = NULL;
                         spin_lock(&dcache_lock);
-
+                        
                         /* It is possible to have several dentries (with
                            racer?) */
-                        while ((list = list->next) != &inode->i_dentry) {
-                                dir = list_entry(list, struct dentry, d_alias);
-#ifdef LUSTRE_KERNEL_VERSION
-                                if (!(dir->d_flags & DCACHE_LUSTRE_INVALID))
-#else
-                                if (!d_unhashed(dir))
-#endif
-                                        break;
-
-                                dir = NULL;
+                        list_for_each_entry_safe(dentry, tmp, 
+                                                 &inode->i_dentry,d_alias) {
+                                if (!list_empty(&dentry->d_subdirs))
+                                        dir = dentry;
+                                alias_counter ++;
                         }
 
+                        if (alias_counter > 1)
+                                CWARN("More than 1 alias dir %lu alias %d\n",
+                                       inode->i_ino, alias_counter);
+
                         if (dir) {
 restart:
                                 list_for_each_entry_safe(dentry, tmp,