Whamcloud - gitweb
b=24243 Invalid WNC intent lock makes server LBUG
authorMatt Wu <matt@ext2fsd.com>
Tue, 7 Dec 2010 11:25:54 +0000 (19:25 +0800)
committerVitaly Fertman <vitaly.fertman@oracle.com>
Tue, 7 Dec 2010 22:05:56 +0000 (01:05 +0300)
i=andreas.dilger
i=oleg.drokin

do not grant PDO locks for non-dir objects, but return -ENOTDIR instead.

lustre/mdt/mdt_handler.c

index da97a53..7300d48 100644 (file)
@@ -2209,7 +2209,8 @@ int mdt_object_lock(struct mdt_thread_info *info, struct mdt_object *o,
                         RETURN(-ESTALE);
                 } else {
                         /* Non-dir object shouldn't have PDO lock */
-                        LASSERT(S_ISDIR(lu_object_attr(&o->mot_obj.mo_lu)));
+                        if (!S_ISDIR(lu_object_attr(&o->mot_obj.mo_lu)))
+                                RETURN(-ENOTDIR);
                 }
         }