Whamcloud - gitweb
- mds_preprw() handles failed mds_fid2dentry() properly
authoralex <alex>
Wed, 23 Jun 2004 04:21:46 +0000 (04:21 +0000)
committeralex <alex>
Wed, 23 Jun 2004 04:21:46 +0000 (04:21 +0000)
lustre/mds/mds_lmv.c

index 3267e6f..b29da76 100644 (file)
@@ -673,7 +673,12 @@ int mds_preprw(int cmd, struct obd_export *exp, struct obdo *oa,
         fid.id = obj->ioo_id;
         fid.generation = obj->ioo_gr;
         dentry = mds_fid2dentry(mds, &fid, NULL);
-        LASSERT(!IS_ERR(dentry));
+        if (IS_ERR(dentry)) {
+                CERROR("can't get dentry for %lu/%lu: %d\n",
+                       (unsigned long) fid.id,
+                       (unsigned long) fid.generation, (int) PTR_ERR(dentry));
+                GOTO(cleanup, rc = (int) PTR_ERR(dentry));
+        }
 
         if (dentry->d_inode == NULL) {
                 CERROR("trying to BRW to non-existent file "LPU64"\n",