Whamcloud - gitweb
- fixed sys_umount() code path. It did not release intent what caused memory leaks...
authoryury <yury>
Thu, 12 May 2005 14:35:27 +0000 (14:35 +0000)
committeryury <yury>
Thu, 12 May 2005 14:35:27 +0000 (14:35 +0000)
- do not free intent in GNS case if it is not lookup_it, only drop lock.
- added test_3a which checks disabling GNS mount point using chmod u-s

lustre/kernel_patches/patches/vfs-intent_release_umount-vanilla-2.6.10-fc3.patch [new file with mode: 0644]
lustre/kernel_patches/series/2.6-fc3-uml.series
lustre/kernel_patches/series/2.6-fc3.series
lustre/llite/dcache.c
lustre/llite/namei.c
lustre/mds/mds_open.c
lustre/tests/sanity-gns.sh

diff --git a/lustre/kernel_patches/patches/vfs-intent_release_umount-vanilla-2.6.10-fc3.patch b/lustre/kernel_patches/patches/vfs-intent_release_umount-vanilla-2.6.10-fc3.patch
new file mode 100644 (file)
index 0000000..df85b6b
--- /dev/null
@@ -0,0 +1,10 @@
+--- linux-2.6.10.orig/fs/namei.c       2005-05-12 17:14:20.000000000 +0300
++++ linux-2.6.10/fs/namei.c    2005-05-12 17:19:41.000000000 +0300
+@@ -343,6 +343,7 @@ void path_release(struct nameidata *nd)
+  */
+ void path_release_on_umount(struct nameidata *nd)
+ {
++      intent_release(&nd->intent.open);
+       dput(nd->dentry);
+       _mntput(nd->mnt);
+ }
index ea0859d..295c4a8 100644 (file)
@@ -22,4 +22,4 @@ vfs_gns-2.6.10-fc3.patch
 vfs_lookup_in_file-2.6.patch
 jbd-2.6.10-jcberr.patch
 hostfs_readdir_large.patch
 vfs_lookup_in_file-2.6.patch
 jbd-2.6.10-jcberr.patch
 hostfs_readdir_large.patch
-
+vfs-intent_release_umount-vanilla-2.6.10-fc3.patch
index 6d97e05..3e2783e 100644 (file)
@@ -24,4 +24,4 @@ jbd-2.6.10-jcberr.patch
 hostfs_readdir_large.patch
 linux-2.6.10-fc3-left.patch
 linux-2.6.10-fc3-lkcd.patch 
 hostfs_readdir_large.patch
 linux-2.6.10-fc3-left.patch
 linux-2.6.10-fc3-lkcd.patch 
-
+vfs-intent_release_umount-vanilla-2.6.10-fc3.patch
index 87a828d..427c07a 100644 (file)
@@ -491,22 +491,11 @@ out:
                  * they never should be passed to lookup()
                  */
                 if (!ll_special_name(de)) {
                  * they never should be passed to lookup()
                  */
                 if (!ll_special_name(de)) {
-                        /* XXX umka: if req not NULL we might need free
-                         *     the req we already obtianed?
-                         */
                         LASSERT(req == NULL);
                         LASSERT(req == NULL);
-
                         if (it == &lookup_it) {
                                 ll_intent_release(it);
                         } else {
                         if (it == &lookup_it) {
                                 ll_intent_release(it);
                         } else {
-                                /* 
-                                 * dropping lock and freeing intent allocated in
-                                 * ll_frob_intent(). Do not release it (that is
-                                 * do not put it->magic to 0), as it will be
-                                 * used later by ll_lookup_it(). --umka 
-                                 */
                                 ll_intent_drop_lock(it);
                                 ll_intent_drop_lock(it);
-                                ll_intent_free(it);
                         }
                         ll_unhash_aliases(de->d_inode);
                         RETURN (0);
                         }
                         ll_unhash_aliases(de->d_inode);
                         RETURN (0);
index 0c63cc9..e322639 100644 (file)
@@ -399,10 +399,8 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
             ((flags & LOOKUP_CONTINUE) || (gns_it & (IT_CHDIR | IT_OPEN))))
         {
                 rc = ll_gns_mount_object(dentry, nd->mnt);
             ((flags & LOOKUP_CONTINUE) || (gns_it & (IT_CHDIR | IT_OPEN))))
         {
                 rc = ll_gns_mount_object(dentry, nd->mnt);
-                if (rc == -ERESTARTSYS) {
-                        /* causing syscall restart */
+                if (rc == -ERESTARTSYS)
                         GOTO(out, retval = ERR_PTR(-ERESTARTSYS));
                         GOTO(out, retval = ERR_PTR(-ERESTARTSYS));
-                }
 
                 if (rc) {
                         /* 
 
                 if (rc) {
                         /* 
index 37d21bf..4396fe5 100644 (file)
@@ -1039,7 +1039,7 @@ got_child:
                 mds_pack_dentry2body(obd, body, dchild, 1);
                 intent_set_disposition(rep, DISP_LOOKUP_POS);
                 intent_set_disposition(rep, DISP_LOOKUP_EXECD);
                 mds_pack_dentry2body(obd, body, dchild, 1);
                 intent_set_disposition(rep, DISP_LOOKUP_POS);
                 intent_set_disposition(rep, DISP_LOOKUP_EXECD);
-
+                
 #ifdef S_PDIROPS
                 if (parent_lockh[1].cookie != 0)
                         ldlm_lock_decref(parent_lockh + 1, update_mode);
 #ifdef S_PDIROPS
                 if (parent_lockh[1].cookie != 0)
                         ldlm_lock_decref(parent_lockh + 1, update_mode);
index 59e08f5..e03b0df 100644 (file)
@@ -1084,6 +1084,63 @@ $TIMOUT $TICK GENERIC BG OPEN || {
 
 run_test 2h " odd conditions (mounting in background) ==================="
 
 
 run_test 2h " odd conditions (mounting in background) ==================="
 
+test_3a() {
+    local LOOP_DEV=$(find_free_loop 2>/dev/null)
+    local LOOP_FILE="$TMP/gns_loop_3a"
+    local OBJECT=".mntinfo"
+    local TIMOUT=5
+    local TICK=1
+
+    test "x$LOOP_DEV" != "x" && test -b $LOOP_DEV ||
+       error "can't find free loop device"
+
+    echo "preparing loop device $LOOP_DEV <-> $LOOP_FILE..."
+    cleanup_loop $LOOP_DEV $LOOP_FILE
+    setup_loop $LOOP_DEV $LOOP_FILE || error
+
+    echo "setting up GNS timeouts and mount object..."
+    setup_gns $OBJECT $TIMOUT $TICK || error
+
+    disable_gns
+
+    echo "preparing mount object at $DIR/gns_test_3a/$OBJECT..."
+    setup_object $DIR/gns_test_3a $OBJECT "-t ext2 $LOOP_DEV" || error
+
+    enable_gns
+
+    echo ""
+    echo "testing GNS with GENERIC upcall in GENERIC mode"
+    
+    check_gns GENERIC $DIR/gns_test_3a $DIR/gns_test_3a \
+$TIMOUT $TICK GENERIC FG OPEN || {
+        disable_gns
+        cleanup_object $DIR/gns_test_3a
+        cleanup_loop $LOOP_DEV $LOOP_FILE
+        error
+    }
+    
+    chmod u-s $DIR/gns_test_3a || {
+        disable_gns
+        cleanup_object $DIR/gns_test_3a
+        cleanup_loop $LOOP_DEV $LOOP_FILE
+       error "can't chmod u-s $DIR/gns_test_3a"
+    }
+    
+    check_mnt $DIR/gns_test_3a && {
+        disable_gns
+        cleanup_object $DIR/gns_test_3a
+        cleanup_loop $LOOP_DEV $LOOP_FILE
+       error "chmod u-s $DIR/gns_test_3a caused mounting"
+    }
+    
+    disable_gns
+    cleanup_object $DIR/gns_test_3a
+    cleanup_loop $LOOP_DEV $LOOP_FILE
+    return 0
+}
+
+run_test 3a " removing mnt by chmod u-s ================================="
+
 TMPDIR=$OLDTMPDIR
 TMP=$OLDTMP
 HOME=$OLDHOME
 TMPDIR=$OLDTMPDIR
 TMP=$OLDTMP
 HOME=$OLDHOME