Whamcloud - gitweb
land b1_4_smallfix:
authornic <nic>
Mon, 4 Oct 2004 20:00:47 +0000 (20:00 +0000)
committernic <nic>
Mon, 4 Oct 2004 20:00:47 +0000 (20:00 +0000)
- properly handle portals process identifiers in messages (4165)
- finish default directory EA handling (3048)
- removed PTL_MD_KIOV usage under CRAY_PORTALS (4420)
- ignore -ENOENT errors in osc_destroy (3639)
- notify osc create thread that OSC is being cleaned up (4600)
- add nettype argument for llmount in #5d in conf-sanity.sh (3936)
- reconstruct ost_handle() like mds_handle() (4657)
- create a new thread to do import eviction to avoid deadlock (3969)
- let lconf resolve symlinked-to devices (4629)
- don't unlink "objects" from directory with default EA (4554)
- allocate qswnal tx descriptors singly to avoid fragmentation (4504)
- allow more than 32000 subdirectories in a single directory (3244)
- OST returns ENOSPC from object create when no space left (4539)
- limit OSC precreate to 1/2 of value OST considers bogus (4778)
- bind to privileged port in socknal and tcpnal (3689)
- rate limit CERROR/CWARN console message to avoid overload (4519)

lustre/mds/mds_unlink_open.c

index 6f7e3da..a776451 100644 (file)
@@ -93,13 +93,23 @@ static int mds_unlink_orphan(struct obd_device *obd, struct dentry *dchild,
         struct mds_obd *mds = &obd->u.mds;
         struct lov_mds_md *lmm = NULL;
         struct llog_cookie *logcookies = NULL;
-        int lmm_size = 0, log_unlink = 0;
+        int lmm_size, log_unlink = 0;
         void *handle = NULL;
         int rc, err;
         ENTRY;
 
         LASSERT(mds->mds_osc_obd != NULL);
 
+        /* We don't need to do any of these other things for orhpan dirs,
+         * especially not mds_get_md (may get a default LOV EA, bug 4554) */
+        if (S_ISDIR(inode->i_mode)) {
+                rc = vfs_rmdir(pending_dir, dchild);
+                if (rc)
+                        CERROR("error %d unlinking dir %*s from PENDING\n",
+                               rc, dchild->d_name.len, dchild->d_name.name);
+                RETURN(rc);
+        }
+
         lmm_size = mds->mds_max_mdsize;
         OBD_ALLOC(lmm, lmm_size);
         if (lmm == NULL)
@@ -118,16 +128,11 @@ static int mds_unlink_orphan(struct obd_device *obd, struct dentry *dchild,
                 GOTO(out_free_lmm, rc);
         }
 
-        if (S_ISDIR(inode->i_mode))
-                rc = vfs_rmdir(pending_dir, dchild);
-        else
-                rc = vfs_unlink(pending_dir, dchild);
-
-        if (rc)
-                CERROR("error %d unlinking orphan %*s from PENDING directory\n",
+        rc = vfs_unlink(pending_dir, dchild);
+        if (rc) {
+                CERROR("error %d unlinking orphan %.*s from PENDING\n",
                        rc, dchild->d_name.len, dchild->d_name.name);
-
-        if (!rc && lmm_size) {
+        } else if (lmm_size) {
                 OBD_ALLOC(logcookies, mds->mds_max_cookiesize);
                 if (logcookies == NULL)
                         rc = -ENOMEM;
@@ -135,13 +140,13 @@ static int mds_unlink_orphan(struct obd_device *obd, struct dentry *dchild,
                                            mds->mds_max_cookiesize) > 0)
                         log_unlink = 1;
         }
+
         err = fsfilt_commit(obd, pending_dir, handle, 0);
         if (err) {
                 CERROR("error committing orphan unlink: %d\n", err);
                 if (!rc)
                         rc = err;
-        }
-        if (!rc) {
+        } else if (!rc) {
                 rc = mds_osc_destroy_orphan(mds, inode, lmm, lmm_size,
                                             logcookies, log_unlink);
         }