- 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
--- /dev/null
+--- 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);
+ }
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
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
* 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);
-
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_free(it);
}
ll_unhash_aliases(de->d_inode);
RETURN (0);
((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));
- }
if (rc) {
/*
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);
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