Whamcloud - gitweb
- added comment in mds_open() and GNS mount points.
authoryury <yury>
Tue, 19 Apr 2005 12:27:07 +0000 (12:27 +0000)
committeryury <yury>
Tue, 19 Apr 2005 12:27:07 +0000 (12:27 +0000)
- cleanups in sanity-gns.sh
- added one more GNS test - mounting directory with absent mount object

lustre/mds/mds_open.c
lustre/tests/sanity-gns.sh

index 1e55c57..2cf2d91 100644 (file)
@@ -1182,14 +1182,12 @@ got_child:
                 if (ll_permission(dchild->d_inode, acc_mode, NULL))
                         GOTO(cleanup, rc = -EACCES);
 
                 if (ll_permission(dchild->d_inode, acc_mode, NULL))
                         GOTO(cleanup, rc = -EACCES);
 
-#if 0
-                /* skip GNS suid bit marked directories. */
-                if (dchild->d_inode->i_mode & S_ISUID) {
-                        CDEBUG(D_INODE, "found GNS mount object %*s, not opening.\n", 
-                               dchild->d_name.len, dchild->d_name.name);
-                        GOTO(cleanup, rc = 0); // success, but don't really open
-                }
-#endif
+                /* 
+                 * here was checking for possible GNS mount point to skip their
+                 * open. I removed it as its detection based only on SUID bit is
+                 * not reliable. Opening such an dirs should not cause any
+                 * problems, at least tests show that. --umka
+                 */
         }
 
         /* if we are following a symlink, don't open */
         }
 
         /* if we are following a symlink, don't open */
index 73c24e2..99c2727 100644 (file)
@@ -643,7 +643,7 @@ test_2a() {
     rm -fr $DIR/gns_test_2a
 }
 
     rm -fr $DIR/gns_test_2a
 }
 
-run_test 2a " check for evil conditions (object is symlink) ============="
+run_test 2a " odd conditions (mount object is symlink) ============="
 
 test_2b() {
     local OBJECT=".mntinfo"
 
 test_2b() {
     local OBJECT=".mntinfo"
@@ -669,7 +669,7 @@ test_2b() {
     rm -fr $DIR/gns_test_2b
 }
 
     rm -fr $DIR/gns_test_2b
 }
 
-run_test 2b " check for evil conditions (object is directory) ==========="
+run_test 2b " odd conditions (mount object is directory) ==========="
 
 test_2c() {
     local OBJECT=".mntinfo"
 
 test_2c() {
     local OBJECT=".mntinfo"
@@ -686,7 +686,7 @@ test_2c() {
     echo ""
     echo "testing GNS with GENERIC upcall"
     check_gns GENERIC $DIR/gns_test_2c $DIR/gns_test_2c $TIMOUT $TICK GENERIC && {
     echo ""
     echo "testing GNS with GENERIC upcall"
     check_gns GENERIC $DIR/gns_test_2c $DIR/gns_test_2c $TIMOUT $TICK GENERIC && {
-       chmod u-s $DIR/gns_test_2c
+       chmod u-s -R $DIR/gns_test_2c
        rm -fr $DIR/gns_test_2c
         error "recursive mounting of dir as mount object works?"
     }
        rm -fr $DIR/gns_test_2c
         error "recursive mounting of dir as mount object works?"
     }
@@ -695,9 +695,35 @@ test_2c() {
     rm -fr $DIR/gns_test_2c
 }
 
     rm -fr $DIR/gns_test_2c
 }
 
-run_test 2c " check for evil conditions (object is recursive dirs) ======"
+run_test 2c " odd conditions (mount object is recursive dir) ======="
 
 
-test_3a() {
+test_2d() {
+    local OBJECT=".mntinfo"
+    local TIMOUT=5
+    local TICK=1
+
+    echo "setting up GNS timeouts and mount object..."
+    setup_gns $OBJECT $TIMOUT $TICK || error
+
+    echo "preparing mount object at $DIR/gns_test_2d/$OBJECT..."
+    mkdir -p $DIR/gns_test_2d
+    chmod u+s $DIR/gns_test_2d
+    
+    echo ""
+    echo "testing GNS with GENERIC upcall"
+    check_gns GENERIC $DIR/gns_test_2d $DIR/gns_test_2d $TIMOUT $TICK GENERIC && {
+       chmod u-s $DIR/gns_test_2d
+       rm -fr $DIR/gns_test_2d
+        error "mount point with absent mount object works?"
+    }
+    
+    chmod u-s $DIR/gns_test_2d
+    rm -fr $DIR/gns_test_2d
+}
+
+run_test 2d " odd conditions (mount object is absent) =============="
+
+test_2e() {
     local OBJECT=".mntinfo"
     local TIMOUT=5
     local TICK=1
     local OBJECT=".mntinfo"
     local TIMOUT=5
     local TICK=1
@@ -722,7 +748,7 @@ test_3a() {
        error "'..a' is not set as mount object name"
 }
 
        error "'..a' is not set as mount object name"
 }
 
-run_test 3a " check for evil conditions ('.' and '..' as mount object) =="
+run_test 2e " odd conditions ('.' and '..' as mount object) ============="
 
 TMPDIR=$OLDTMPDIR
 TMP=$OLDTMP
 
 TMPDIR=$OLDTMPDIR
 TMP=$OLDTMP