Whamcloud - gitweb
- lustre_mds.h: just shrink_dcache on de
authorpschwan <pschwan>
Tue, 2 Apr 2002 17:48:06 +0000 (17:48 +0000)
committerpschwan <pschwan>
Tue, 2 Apr 2002 17:48:06 +0000 (17:48 +0000)
- file.c: reverse the order of the MDS/OST open RPCs
- runfailure-net: do unmount/mount after each test

lustre/include/linux/lustre_mds.h
lustre/llite/file.c
lustre/tests/runfailure-net

index 8e53121..101d249 100644 (file)
 
 static inline void l_dput(struct dentry *de) 
 {
-        struct dentry *parent;
         if (!de || IS_ERR(de)) 
                 return; 
         shrink_dcache_parent(de); 
-        parent = de->d_parent;
-        if (parent)
-                dget(parent);
         dput(de); 
-        if (parent) { 
-                shrink_dcache_parent(parent); 
-                dput(parent);
-        }
 }
 
 #define LUSTRE_MDS_NAME "mds"
index 12f6f08..71d2b95 100644 (file)
@@ -58,9 +58,20 @@ static int ll_file_open(struct inode *inode, struct file *file)
                 LBUG();
 
         fd = kmem_cache_alloc(ll_file_data_slab, SLAB_KERNEL); 
-        if (!fd) { 
-                rc = -ENOMEM;
-                goto out;
+        if (!fd)
+                GOTO(out, rc = -ENOMEM);
+        memset(fd, 0, sizeof(*fd));
+
+        rc = mdc_open(&sbi->ll_mds_client, inode->i_ino, S_IFREG,
+                      file->f_flags, &fd->fd_mdshandle, &req); 
+        if (!fd->fd_mdshandle)
+                CERROR("mdc_open didn't assign fd_mdshandle\n");
+
+        ptlrpc_free_req(req);
+        if (rc) {
+                if (rc > 0) 
+                        rc = -rc;
+                GOTO(out, rc);
         }
 
         oa = ll_oa_from_inode(inode, (OBD_MD_FLMODE | OBD_MD_FLID));
@@ -68,36 +79,25 @@ static int ll_file_open(struct inode *inode, struct file *file)
                 LBUG();
         rc = obd_open(ll_i2obdconn(inode), oa); 
         obdo_free(oa);
-        if (rc) { 
+        if (rc) {
+                /* XXX: Need to do mdc_close here! */
                 if (rc > 0) 
                         rc = -rc;
-                EXIT;
-                goto out;
+                GOTO(out, rc);
         }
 
-        rc = mdc_open(&sbi->ll_mds_client, inode->i_ino, S_IFREG,
-                      file->f_flags, &fd->fd_mdshandle, &req); 
-        if (!fd->fd_mdshandle) 
-                LBUG();
-
-        ptlrpc_free_req(req);
-        if (rc) { 
-                if (rc > 0) 
-                        rc = -rc;
-                EXIT;
-                goto out;
-        }
         file->private_data = fd;
 
         EXIT; 
  out:
-        if (rc && fd)
+        if (rc && fd) {
                 kmem_cache_free(ll_file_data_slab, fd); 
+                file->private_data = NULL;
+        }
 
         return rc;
 }
 
-
 static int ll_file_release(struct inode *inode, struct file *file)
 {
         int rc;
@@ -112,8 +112,7 @@ static int ll_file_release(struct inode *inode, struct file *file)
         fd = (struct ll_file_data *)file->private_data;
         if (!fd || !fd->fd_mdshandle) { 
                 LBUG();
-                rc = -EINVAL;
-                goto out;
+                GOTO(out, rc = -EINVAL);
         }
 
         oa = ll_oa_from_inode(inode, (OBD_MD_FLMODE | OBD_MD_FLID));
@@ -124,8 +123,7 @@ static int ll_file_release(struct inode *inode, struct file *file)
         if (rc) { 
                 if (rc > 0) 
                         rc = -rc;
-                EXIT;
-                goto out;
+                GOTO(out, rc);
         }
 
         iattr.ia_valid = ATTR_SIZE;
@@ -142,8 +140,7 @@ static int ll_file_release(struct inode *inode, struct file *file)
         if (rc) { 
                 if (rc > 0) 
                         rc = -rc;
-                EXIT;
-                goto out;
+                GOTO(out, rc);
         }
         EXIT; 
 
index 912b5cb..bd2d141 100755 (executable)
@@ -8,15 +8,21 @@ run() {
        $* &
        sleep 1
        kill -9 $!
+
+        echo 0 > /proc/sys/lustre/fail_loc
+        umount /mnt/obd
+        mount -t lustre_light -o device=3 none /mnt/obd
 }
 
 mknod /dev/request c 10 244
 
+sh llmount.sh
+
 # GETATTR_NET - ls will hang on the getattr
-run 0x102 ls /mnt/obd/lost+found
+run 0x102 ls -l /mnt/obd
 
 # READPAGE_NET - ls will hang reading in new pages (lost+found is not in cache)
-run 0x104 ls /mnt/obd/lost+found
+run 0x104 ls /mnt/obd
 
 sleep 1
 
@@ -27,13 +33,16 @@ run 0x107 touch /mnt/obd
 run 0x107 touch /mnt/obd/tt
 
 # REINT_NET - mv will hang on rename
-run 0x107 mv /mnt/obd/lost+found /mnt/obd/lost
+touch /mnt/obd/foo
+run 0x107 mv /mnt/obd/foo /mnt/obd/bar
 
 # REINT_NET - rm will hang on unlink
-run 0x107 rmdir /mnt/obd/lost+found
+touch /mnt/obd/salmon
+run 0x107 rm /mnt/obd/salmon
 
 # OPEN_NET - touch will hang on open
-run 0x113 touch /mnt/obd/foo
+touch /mnt/obd/foo
+run 0x113 cat /mnt/obd/foo
 
 # CLOSE_NET - ls will hang on close
 run 0x115 ./testreq --close junk_file_handle