- using IT_CHDIR in sys_chdir() vfs-intent_api-vanilla-2.6.10-fc3.patch. This fixes GNS with cd into mnt point.
- different fixes in GNS stuff.
- gns_enabled flag is moved to separate space instead of using LL_GNS_DISABLED
- removed error messages after inode_setattr(). Only comment is added.
- many changes in sanity-gns.sh, added checks for "cd" case. Deadlock tests are disabled for a while.
#define OBD_SLEEP_ON(wq) \
do { \
DEFINE_WAIT(__wait); \
- prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE); \
+ prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \
schedule(); \
finish_wait(&wq, &__wait); \
} while (0)
int error;
- error = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
-+ intent_init(&nd.intent.open, IT_GETATTR);
++ intent_init(&nd.intent.open, IT_CHDIR);
+ error = __user_walk_it(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
if (error)
goto out;
-#define DCACHE_CROSS_REF 0x0040 /* entry points to inode on another MDS */
+#define DCACHE_CROSS_REF 0x0040 /* entry points to inode on another MDS */
-+#define DCACHE_GNS_PENDING 0x0080 /* entry is GNS pending mount point */
-+#define DCACHE_GNS_MOUNTING 0x0100 /* entry is GNS mount in progress */
++
++
+
extern spinlock_t dcache_lock;
struct it_cb_data icbd;
struct lustre_id pid;
struct lustre_id cid;
- int orig_it, rc = 0;
+ int gns_it, rc = 0;
ENTRY;
CDEBUG(D_VFSTRACE, "VFS Op:name=%s (%p), intent=%s\n", de->d_name.name,
nd->mnt->mnt_last_used = jiffies;
OBD_FAIL_TIMEOUT(OBD_FAIL_MDC_REVALIDATE_PAUSE, 5);
- orig_it = it ? it->it_op : IT_OPEN;
+
+ gns_it = it ? it->it_op : IT_OPEN;
ll_frob_intent(&it, &lookup_it);
+
LASSERT(it != NULL);
if (it->it_op == IT_GETATTR) { /* We need to check for LOOKUP lock as
ll_intent_release(&lookup_it);
}
-#if 1
+ /* open lock stuff */
if ((it->it_op == IT_OPEN) && de->d_inode) {
struct inode *inode = de->d_inode;
struct ll_inode_info *lli = ll_i2info(inode);
ldlm_lock_decref(&lockh, lockmode);
}
}
-#endif
do_lock:
rc = md_intent_lock(exp, &pid, de->d_name.name, de->d_name.len,
return 0;
}
- CDEBUG(D_DENTRY, "revalidated dentry %*s (%p) parent %p "
- "inode %p refc %d\n", de->d_name.len,
- de->d_name.name, de, de->d_parent, de->d_inode,
- atomic_read(&de->d_count));
-
- ll_lookup_finish_locks(it, de);
- de->d_flags &= ~DCACHE_LUSTRE_INVALID;
- if (it == &lookup_it)
- ll_intent_release(it);
-
/*
* if we found that this is possible GNS mount and dentry is still valid
* and may be used by system, we drop the lock and return 0, that means
* lookup control path, which is always made with parent's i_sem taken.
* --umka
*/
- if (((de->d_inode->i_mode & S_ISUID) && S_ISDIR(de->d_inode->i_mode)) ||
- !(flags & LOOKUP_CONTINUE || (orig_it & (IT_CHDIR | IT_OPEN | IT_GETATTR)))) {
-
- /* special "." and ".." has to be always revalidated */
- if (rc && !ll_special_name(de) && nd != NULL && !(nd->flags & LOOKUP_LAST)) {
+ if (rc &&
+ !(!((de->d_inode->i_mode & S_ISUID) && S_ISDIR(de->d_inode->i_mode)) ||
+ !(flags & LOOKUP_CONTINUE || (gns_it & (IT_CHDIR | IT_OPEN))))) {
+ /*
+ * special "." and ".." has to be always revalidated because
+ * they never should be passed to lookup()
+ */
+ if (!ll_special_name(de)) {
ll_intent_drop_lock(it);
- rc = 0;
+ ll_intent_free(it);
+ ll_unhash_aliases(de->d_inode);
+ return 0;
}
-
- ll_intent_release(it);
- return rc;
}
-
+
+ CDEBUG(D_DENTRY, "revalidated dentry %*s (%p) parent %p "
+ "inode %p refc %d\n", de->d_name.len,
+ de->d_name.name, de, de->d_parent, de->d_inode,
+ atomic_read(&de->d_count));
+
+ ll_lookup_finish_locks(it, de);
+ de->d_flags &= ~DCACHE_LUSTRE_INVALID;
+ ll_intent_release(it);
return rc;
do_lookup:
it = &lookup_it;
static struct ptlrpc_thread gns_thread;
static struct ll_gns_ctl gns_ctl;
+#define CONCUR_GNS_RESTART_APPROACH 0
+
/*
* waits until passed dentry gets mountpoint or timeout and attempts are
* exhausted. Returns 1 if dentry became mountpoint and 0 otherwise.
RETURN(-ETIME);
}
+#if (CONCUR_GNS_RESTART_APPROACH == 1)
/*
* sending a signal known to be ignored to cause restarting syscall if GNS mount
* function returns -ERESTARTSYS.
read_unlock(&tasklist_lock);
set_tsk_thread_flag(task, TIF_SIGPENDING);
}
+#endif
/*
* tries to mount the mount object under passed @dentry. In the case of success
RETURN(-EINVAL);
sbi = ll_i2sbi(dentry->d_inode);
- LASSERT(sbi != NULL);
-
- spin_lock(&sbi->ll_gns_lock);
-
- if (sbi->ll_gns_state == LL_GNS_DISABLED) {
- spin_unlock(&sbi->ll_gns_lock);
- RETURN(-EINVAL);
- }
if (mnt == NULL) {
CERROR("suid directory found, but no "
RETURN(-EINVAL);
}
+ if (atomic_read(&sbi->ll_gns_enabled) == 0)
+ RETURN(-EINVAL);
+
+ spin_lock(&sbi->ll_gns_lock);
+
/*
* another thead is in progress or just finished mounting the
* dentry. Handling that.
if (d_mountpoint(dentry))
RETURN(0);
+#if (CONCUR_GNS_RESTART_APPROACH == 1)
/*
- * causing syscall to restart and find this dentry already
- * mounted.
+ * causing syscall to restart and possibly find this dentry
+ * already mounted.
*/
ll_gns_send_signal();
RETURN(-ERESTARTSYS);
-
-#if 0
+#else
+ /*
+ * waiting for GNS complete and check dentry again, it may be
+ * mounted already.
+ */
wait_for_completion(&sbi->ll_gns_mount_finished);
if (d_mountpoint(dentry))
RETURN(0);
/* check if found child is regular file */
if (!S_ISREG(dchild->d_inode->i_mode))
- GOTO(cleanup, rc = -EOPNOTSUPP);
+ GOTO(cleanup, rc = -EBADF);
mntget(mnt);
up(&sbi->ll_gns_sem);
/* do not wait for helper complete here. */
- rc = call_usermodehelper(argv[0], argv, NULL, 0);
+ rc = call_usermodehelper(argv[0], argv, NULL, 1);
if (rc) {
CWARN("failed to call GNS upcall %s, err = %d, "
"checking for mount anyway\n", sbi->ll_gns_upcall, rc);
* second.
*/
rc = ll_gns_wait_for_mount(dentry, 1, GNS_WAIT_ATTEMPTS);
- complete_all(&sbi->ll_gns_mount_finished);
if (rc == 0) {
struct dentry *rdentry;
struct vfsmount *rmnt;
-
- /* mount is successful */
+
LASSERT(sbi->ll_gns_state == LL_GNS_FINISHED);
rmnt = mntget(mnt);
dput(dchild);
case 1:
free_page((unsigned long)pathpage);
- complete_all(&sbi->ll_gns_mount_finished);
case 0:
spin_lock(&sbi->ll_gns_lock);
sbi->ll_gns_state = LL_GNS_IDLE;
spin_unlock(&sbi->ll_gns_lock);
+ complete_all(&sbi->ll_gns_mount_finished);
}
return rc;
}
struct semaphore ll_gns_sem;
spinlock_t ll_gns_lock;
wait_queue_head_t ll_gns_waitq;
+ atomic_t ll_gns_enabled;
int ll_gns_state;
struct timer_list ll_gns_timer;
struct list_head ll_gns_sbi_head;
#define LL_GNS_IDLE (1 << 0)
#define LL_GNS_MOUNTING (1 << 1)
#define LL_GNS_FINISHED (1 << 2)
-#define LL_GNS_DISABLED (1 << 3)
/* mounts checking flags */
#define LL_GNS_UMOUNT (1 << 0)
/* default values, may be changed via /proc/fs/... */
sbi->ll_gns_state = LL_GNS_IDLE;
+ atomic_set(&sbi->ll_gns_enabled, 1);
sbi->ll_gns_tick = GNS_TICK_TIMEOUT;
sbi->ll_gns_timeout = GNS_MOUNT_TIMEOUT;
* NB: ATTR_SIZE will only be set at this point if the size
* resides on the MDS, ie, this file has no objects. */
attr->ia_valid &= ~ATTR_SIZE;
+
+ /*
+ * assigning inode_setattr() to @err to disable warning that
+ * function's result should be checked by by caller. error is
+ * impossible here, as vmtruncate() control path is disabled.
+ */
err = inode_setattr(inode, attr);
- if (err) {
- CERROR("inode_setattr() failed, inode=%lu/%u(%p), "
- "err = %d\n", (unsigned long)inode->i_ino,
- inode->i_generation, inode, err);
- /* should we go to error path here? --umka */
- }
-
ll_update_inode(inode, &md);
ptlrpc_req_finished(request);
}
}
- /* Won't invoke vmtruncate, as we already cleared ATTR_SIZE */
+ /* won't invoke vmtruncate, as we already cleared ATTR_SIZE */
err = inode_setattr(inode, attr);
- if (err) {
- CERROR("inode_setattr() failed, inode=%lu/%u(%p), "
- "err = %d\n", (unsigned long)inode->i_ino,
- inode->i_generation, inode, err);
- /* should we go to error path here? --umka */
- }
+ /*
+ * assigning inode_setattr() to @err to disable warning that
+ * function's result should be checked by by caller. error is
+ * impossible here, as vmtruncate() control path is disabled.
+ */
}
/* We really need to get our PW lock before we change inode->i_size.
{
struct super_block *sb = (struct super_block *)data;
struct ll_sb_info *sbi = ll_s2sbi(sb);
- int enabled = 0;
-
- spin_lock(&sbi->ll_gns_lock);
- enabled = (sbi->ll_gns_state == LL_GNS_DISABLED ? 0 : 1);
- spin_unlock(&sbi->ll_gns_lock);
-
- return snprintf(page, count, "%d\n", enabled);
+
+ return snprintf(page, count, "%d\n",
+ atomic_read(&sbi->ll_gns_enabled));
}
static int ll_wr_gns_enabled(struct file *file, const char *buffer,
if (rc)
return rc;
- spin_lock(&sbi->ll_gns_lock);
- if (val == 0 && sbi->ll_gns_state == LL_GNS_IDLE) {
- sbi->ll_gns_state = LL_GNS_DISABLED;
- goto out;
- }
- if (val == 1 && sbi->ll_gns_state == LL_GNS_DISABLED) {
- sbi->ll_gns_state = LL_GNS_IDLE;
- goto out;
- }
-out:
- spin_unlock(&sbi->ll_gns_lock);
+ atomic_set(&sbi->ll_gns_enabled, (val != 0 ? 1 : 0));
return count;
}
struct it_cb_data icbd;
struct ptlrpc_request *req = NULL;
struct lookup_intent lookup_it = { .it_op = IT_LOOKUP };
- int rc, orig_it;
+ int rc, gns_it;
ENTRY;
if (dentry->d_name.len > EXT3_NAME_LEN)
if (nd != NULL)
nd->mnt->mnt_last_used = jiffies;
- orig_it = it ? it->it_op : IT_OPEN;
+ gns_it = nd ? nd->intent.open.it_op : IT_OPEN;
ll_frob_intent(&it, &lookup_it);
icbd.icbd_childp = &dentry;
ll_lookup_finish_locks(it, dentry);
- if (nd &&
- dentry->d_inode != NULL && dentry->d_inode->i_mode & S_ISUID &&
- S_ISDIR(dentry->d_inode->i_mode) &&
- ((flags & LOOKUP_CONTINUE) || (orig_it & (IT_CHDIR | IT_OPEN | IT_GETATTR))))
+ if (nd && dentry->d_inode != NULL &&
+ dentry->d_inode->i_mode & S_ISUID && S_ISDIR(dentry->d_inode->i_mode) &&
+ ((flags & LOOKUP_CONTINUE) || (gns_it & (IT_CHDIR | IT_OPEN))))
{
rc = ll_gns_mount_object(dentry, nd->mnt);
if (rc == -ERESTARTSYS) {
* just reporting about GNS failures, lookup() is
* successful, do not stop it.
*
- * GNS failure may be that found object is found in SUID
- * bit marked dir but it is not regular file and we
- * should lookup further until we find correct mount
+ * GNS failure may be that object is found in SUID bit
+ * marked dir but it is not regular file and we should
+ * lookup further until we find correct mount
* object. This will allow to perform GNS mount is the
* following case for instance:
*
build_test_filter
echo preparing for tests involving mounts
-EXT2_DEV=${EXT2_DEV:-/tmp/SANITY.LOOP}
+EXT2_DEV=${EXT2_DEV:-$TMP/SANITY.LOOP}
touch $EXT2_DEV
mke2fs -j -F $EXT2_DEV 8000 >/dev/null 2>&1
local LOG=$3
local BG=$4
- test "x$BG" = "xBACKGROUND" &&
+ test "x$BG" = "xBG" &&
BG="&" || BG=""
- test "x$MODE" = "xDEADLOCK" &&
- INJECTION="touch \$MNTPATH/file"
+# test "x$MODE" = "xDEADLOCK" &&
+# INJECTION="touch \$MNTPATH/file"
cat > $UPCALL <<- EOF
#!/bin/sh
}
check_gns() {
- local LOG="/tmp/gns-log"
+ local LOG="$TMP/gns-log"
local UPCALL_PATH=""
local UPCALL=$1
local TICK=$5
local MODE=$6
local BG=$7
+ local OP=$8
rm -fr $LOG >/dev/null 2>&1
- UPCALL_PATH="/tmp/gns-upcall-$UPCALL.sh"
+ UPCALL_PATH="$TMP/gns-upcall-$UPCALL.sh"
echo "generating upcall $UPCALL_PATH"
setup_upcall $UPCALL_PATH $UPCALL $LOG $BG || return $rc
echo "$UPCALL_PATH" > /proc/fs/lustre/llite/fs0/gns_upcall || return $?
echo "upcall: $(cat /proc/fs/lustre/llite/fs0/gns_upcall)"
-# local OLD_PWD=$(pwd)
+ echo -n "mount on $OP: "
+
+ local OLD_PWD=$(pwd)
+
case "$MODE" in
GENERIC)
- echo -n "mount on open $OBJECT1/test_file1 (generic): "
- echo -n "test data" > $OBJECT1/test_file1 >/dev/null 2>&1 || return $?
-# cd $OBJECT1 || return $?
+ case "$OP" in
+ OPEN)
+ echo -n "test data" > $OBJECT1/test_file1 >/dev/null 2>&1
+ ;;
+ CHDIR)
+ cd $OBJECT1 || return $?
+ ;;
+ *)
+ echo "invalid testing operation $OP"
+ return 1
+ esac
;;
CONCUR1)
local i=1
local nr=20
- echo -n "mount on open $OBJECT1/test_file1 ($nr threads): "
for ((;i<=$nr;i++)); do
- echo -n "test data" > $OBJECT1/test_file$i >/dev/null 2>&1 &
+ case "$OP" in
+ OPEN)
+ echo -n "test data" > $OBJECT1/test_file$i >/dev/null 2>&1 &
+ ;;
+ CHDIR)
+ cd $OBJECT1 >/dev/null 2>&1 &
+ ;;
+ *)
+ echo "invalid testing operation $OP"
+ return 1
+ esac
done
wait
echo "not defined object2 for concurrent2 testing"
return 1
}
- echo -n "mount on open $OBJECT1/test_file1: "
- echo -n "mount on open $OBJECT2/test_file1: "
- echo -n "test data" > $OBJECT1/test_file1 >/dev/null 2>&1 &
- echo -n "test data" > $OBJECT2/test_file1 >/dev/null 2>&1 &
+ case "$OP" in
+ OPEN)
+ echo -n "test data" > $OBJECT1/test_file1 >/dev/null 2>&1 &
+ echo -n "test data" > $OBJECT2/test_file1 >/dev/null 2>&1 &
+ ;;
+ CHDIR)
+ cd $OBJECT1 >/dev/null 2>&1 &
+ cd $OBJECT2 >/dev/null 2>&1 &
+ ;;
+ *)
+ echo "invalid testing operation $OP"
+ return 1
+ esac
wait
return $RETVAL
;;
CONCUR3)
- echo -n "mount on open $OBJECT1/test_file1: "
-
local i=1
local nr=20
for ((;i<$nr;i++)); do
- touch $OBJECT1/file$i &
- echo -n "test data" > $OBJECT1/test_file$i >/dev/null 2>&1 &
- mkdir $OBJECT1/dir$i &
+ case "$OP" in
+ OPEN)
+ touch $OBJECT1/file$i &
+ echo -n "test data" > $OBJECT1/test_file$i >/dev/null 2>&1 &
+ mkdir $OBJECT1/dir$i &
+ ;;
+ CHDIR)
+ touch $OBJECT1/file$i &
+ cd $OBJECT1 >/dev/null 2>&1 &
+ mkdir $OBJECT1/dir$i &
+ ;;
+ *)
+ echo "invalid testing operation $OP"
+ return 1
+ esac
done
wait
return 1
esac
-# cd $OLD_PWD
+ test "x$OP" = "xCHDIR" && cd $OLD_PWD
check_mnt $OBJECT1 || {
echo "fail"
test_1a() {
local LOOP_DEV=$(find_free_loop 2>/dev/null)
- local LOOP_FILE="/tmp/gns_loop_1a"
+ local LOOP_FILE="$TMP/gns_loop_1a"
local OBJECT=".mntinfo"
local TIMOUT=5
local TICK=1
echo ""
echo "testing GNS with GENERIC upcall 3 times on the row"
+ echo ""
+ echo "testing OPEN operation"
+
for ((i=0;i<3;i++)); do
- check_gns GENERIC $DIR/gns_test_1a $DIR/gns_test_1a $TIMOUT $TICK GENERIC || {
+ check_gns GENERIC $DIR/gns_test_1a $DIR/gns_test_1a $TIMOUT $TICK GENERIC FG OPEN || {
+ disable_gns
+ cleanup_object $DIR/gns_test_1a
+ cleanup_loop $LOOP_DEV $LOOP_FILE
+ error
+ }
+ done
+
+ echo ""
+ echo "testing CHDIR operation"
+
+ for ((i=0;i<3;i++)); do
+ check_gns GENERIC $DIR/gns_test_1a $DIR/gns_test_1a $TIMOUT $TICK GENERIC FG CHDIR || {
disable_gns
cleanup_object $DIR/gns_test_1a
cleanup_loop $LOOP_DEV $LOOP_FILE
cleanup_object $DIR/gns_test_1a
cleanup_loop $LOOP_DEV $LOOP_FILE
+ return 0
}
run_test 1a " general GNS test - mount/umount (GENERIC) ================"
test_1b() {
local LOOP_DEV=$(find_free_loop 2>/dev/null)
- local LOOP_FILE="/tmp/gns_loop_1b"
+ local LOOP_FILE="$TMP/gns_loop_1b"
local OBJECT=".mntinfo"
local TIMOUT=5
local TICK=1
echo "testing GNS with DEADLOCK upcall 3 times on the row"
for ((i=0;i<3;i++)); do
- check_gns DEADLOCK $DIR/gns_test_1b $DIR/gns_test_1b $TIMOUT $TICK GENERIC || {
- disable_gns
- cleanup_object $DIR/gns_test_1b
- cleanup_loop $LOOP_DEV $LOOP_FILE
- error
- }
+ check_gns DEADLOCK $DIR/gns_test_1b $DIR/gns_test_1b $TIMOUT $TICK GENERIC FG OPEN
done
disable_gns
cleanup_object $DIR/gns_test_1b
cleanup_loop $LOOP_DEV $LOOP_FILE
+ return 0
}
run_test 1b " general GNS test - mount/umount (DEADLOCK) ==============="
test_1c() {
local LOOP_DEV=$(find_free_loop 2>/dev/null)
- local LOOP_FILE="/tmp/gns_loop_1c"
+ local LOOP_FILE="$TMP/gns_loop_1c"
local OBJECT=".mntinfo"
local TIMOUT=5
local TICK=1
local i=0
for ((;i<4;i++)); do
- local MODE="GENERIC"
-
- test $(($i%2)) -eq 1 && MODE="DEADLOCK"
-
- check_gns $MODE $DIR/gns_test_1c $DIR/gns_test_1c $TIMOUT $TICK GENERIC || {
- disable_gns
- cleanup_object $DIR/gns_test_1c
- cleanup_loop $LOOP_DEV $LOOP_FILE
- error
+ test $(($i%2)) -eq 1 && {
+ check_gns DEADLOCK $DIR/gns_test_1c $DIR/gns_test_1c $TIMOUT $TICK GENERIC FG OPEN
+ } || {
+ check_gns GENERIC $DIR/gns_test_1c $DIR/gns_test_1c $TIMOUT $TICK GENERIC FG OPEN || {
+ disable_gns
+ cleanup_object $DIR/gns_test_1c
+ cleanup_loop $LOOP_DEV $LOOP_FILE
+ error "generic upcall does not work!"
+ }
}
+
done
disable_gns
cleanup_object $DIR/gns_test_1c
cleanup_loop $LOOP_DEV $LOOP_FILE
+ return 0
}
run_test 1c " general GNS test - mount/umount (GENERIC/DEADLOCK) ========"
test_1d() {
local LOOP_DEV=$(find_free_loop 2>/dev/null)
- local LOOP_FILE="/tmp/gns_loop_1d"
+ local LOOP_FILE="$TMP/gns_loop_1d"
local OBJECT=".mntinfo"
local TIMOUT=5
local TICK=1
enable_gns
echo ""
- echo "testing GNS with GENERIC/DEADLOCK upcall 4 times on the row in CONCUR1 mode"
+ echo "testing GNS with GENERIC upcall 4 times on the row in CONCUR1 mode"
local i=0
for ((;i<4;i++)); do
- local MODE="GENERIC"
-
- test $(($i%2)) -eq 1 && MODE="DEADLOCK"
-
- check_gns $MODE $DIR/gns_test_1d $DIR/gns_test_1d $TIMOUT $TICK CONCUR1 || {
+ check_gns GENERIC $DIR/gns_test_1d $DIR/gns_test_1d $TIMOUT $TICK CONCUR1 FG OPEN || {
disable_gns
cleanup_object $DIR/gns_test_1d
cleanup_loop $LOOP_DEV $LOOP_FILE
cleanup_object $DIR/gns_test_1d
cleanup_loop $LOOP_DEV $LOOP_FILE
+ return 0
}
run_test 1d " general GNS test - concurrent mount ======================="
test_1e() {
local LOOP_DEV=$(find_free_loop 2>/dev/null)
- local LOOP_FILE="/tmp/gns_loop_1e"
+ local LOOP_FILE="$TMP/gns_loop_1e"
local OBJECT=".mntinfo"
local TIMOUT=5
local TICK=1
echo ""
echo "testing GNS with GENERIC upcall in CONCUR2 mode"
- check_gns GENERIC $DIR/gns_test_1e1 $DIR/gns_test_1e2 $TIMOUT $TICK CONCUR2 || {
+ check_gns GENERIC $DIR/gns_test_1e1 $DIR/gns_test_1e2 $TIMOUT $TICK CONCUR2 FG OPEN || {
disable_gns
cleanup_object $DIR/gns_test_1e1
cleanup_object $DIR/gns_test_1e2
cleanup_object $DIR/gns_test_1e1
cleanup_object $DIR/gns_test_1e2
cleanup_loop $LOOP_DEV $LOOP_FILE
+ return 0
}
run_test 1e " general GNS test - concurrent mount of 2 GNS mounts ======="
echo ""
echo "testing GNS with GENERIC upcall"
- check_gns GENERIC $DIR/gns_test_2a $DIR/gns_test_2a $TIMOUT $TICK GENERIC && {
+ check_gns GENERIC $DIR/gns_test_2a $DIR/gns_test_2a $TIMOUT $TICK GENERIC FG OPEN && {
disable_gns
chmod u-s $DIR/gns_test_2a
rm -fr $DIR/gns_test_2a
disable_gns
chmod u-s $DIR/gns_test_2a
rm -fr $DIR/gns_test_2a
+ return 0
}
run_test 2a " odd conditions (mount object is symlink) ============="
echo ""
echo "testing GNS with GENERIC upcall"
- check_gns GENERIC $DIR/gns_test_2b $DIR/gns_test_2b $TIMOUT $TICK GENERIC && {
+ check_gns GENERIC $DIR/gns_test_2b $DIR/gns_test_2b $TIMOUT $TICK GENERIC FG OPEN && {
disable_gns
chmod u-s $DIR/gns_test_2b
rm -fr $DIR/gns_test_2b
disable_gns
chmod u-s $DIR/gns_test_2b
rm -fr $DIR/gns_test_2b
+ return 0
}
run_test 2b " odd conditions (mount object is directory) ==========="
echo ""
echo "testing GNS with GENERIC upcall"
- check_gns GENERIC $DIR/gns_test_2c $DIR/gns_test_2c $TIMOUT $TICK GENERIC && {
+ check_gns GENERIC $DIR/gns_test_2c $DIR/gns_test_2c $TIMOUT $TICK GENERIC FG OPEN && {
disable_gns
chmod u-s -R $DIR/gns_test_2c
rm -fr $DIR/gns_test_2c
disable_gns
chmod u-s $DIR/gns_test_2c
rm -fr $DIR/gns_test_2c
+ return 0
}
run_test 2c " odd conditions (mount object is recursive dir) ======="
echo ""
echo "testing GNS with GENERIC upcall"
- check_gns GENERIC $DIR/gns_test_2d $DIR/gns_test_2d $TIMOUT $TICK GENERIC && {
+ check_gns GENERIC $DIR/gns_test_2d $DIR/gns_test_2d $TIMOUT $TICK GENERIC FG OPEN && {
disable_gns
chmod u-s $DIR/gns_test_2d
rm -fr $DIR/gns_test_2d
disable_gns
chmod u-s $DIR/gns_test_2d
rm -fr $DIR/gns_test_2d
+ return 0
}
run_test 2d " odd conditions (mount object is absent) =============="
echo "..a" > /proc/fs/lustre/llite/fs0/gns_object_name
test "x$(cat /proc/fs/lustre/llite/fs0/gns_object_name)" = "x..a" ||
error "'..a' is not set as mount object name"
+ return 0
}
run_test 2e " odd conditions ('.' and '..' as mount object) ============="
test_2f() {
local LOOP_DEV=$(find_free_loop 2>/dev/null)
- local LOOP_FILE="/tmp/gns_loop_2f"
+ local LOOP_FILE="$TMP/gns_loop_2f"
local OBJECT=".mntinfo"
local TIMOUT=5
local TICK=1
enable_gns
echo ""
- echo "testing GNS with DEADLOCK upcall in CONCUR3 mode"
+ echo "testing GNS with GENERIC upcall in CONCUR3 mode"
- local MODE="DEADLOCK"
-
- check_gns $MODE $DIR/gns_test_2f $DIR/gns_test_2f $TIMOUT $TICK CONCUR3 || {
+ check_gns GENERIC $DIR/gns_test_2f $DIR/gns_test_2f $TIMOUT $TICK CONCUR3 FG OPEN || {
disable_gns
cleanup_object $DIR/gns_test_2f
cleanup_loop $LOOP_DEV $LOOP_FILE
- error
+ error "mount during modifying mount point does not work"
}
disable_gns
cleanup_object $DIR/gns_test_2f
cleanup_loop $LOOP_DEV $LOOP_FILE
+ return 0
}
run_test 2f " odd conditions (mount point is modifying during mount) ===="
test_2g() {
local LOOP_DEV=$(find_free_loop 2>/dev/null)
- local LOOP_FILE="/tmp/gns_loop_2g"
+ local LOOP_FILE="$TMP/gns_loop_2g"
local OBJECT=".mntinfo"
local TIMOUT=5
local TICK=1
enable_gns
echo ""
- echo "testing GNS with DEADLOCK upcall in GENERIC mode"
+ echo "testing GNS with GENERIC upcall in GENERIC mode"
- local MODE="DEADLOCK"
-
- check_gns $MODE $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT \
-$DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT $TIMOUT $TICK GENERIC || {
+ check_gns GENERIC $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT \
+$DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT $TIMOUT $TICK GENERIC FG OPEN || {
disable_gns
cleanup_object $DIR/gns_test_2g
cleanup_loop $LOOP_DEV $LOOP_FILE
enable_gns
- check_gns $MODE $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT \
-$DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT $TIMOUT $TICK GENERIC && {
+ check_gns GENERIC $DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT \
+$DIR/gns_test_2g/$OBJECT/$OBJECT/$OBJECT $TIMOUT $TICK GENERIC FG OPEN && {
disable_gns
cleanup_object $DIR/gns_test_2g
cleanup_loop $LOOP_DEV $LOOP_FILE
cleanup_object $DIR/gns_test_2g
cleanup_loop $LOOP_DEV $LOOP_FILE
+ return 0
}
run_test 2g " odd conditions (mount point is recursive marked SUID dir) ="
test_2h() {
local LOOP_DEV=$(find_free_loop 2>/dev/null)
- local LOOP_FILE="/tmp/gns_loop_2h"
+ local LOOP_FILE="$TMP/gns_loop_2h"
local OBJECT=".mntinfo"
local TIMOUT=5
local TICK=1
echo "testing GNS with GENERIC upcall in GENERIC mode"
check_gns GENERIC $DIR/gns_test_2h $DIR/gns_test_2h \
-$TIMOUT $TICK GENERIC BACKGROUND || {
+$TIMOUT $TICK GENERIC BG OPEN || {
disable_gns
cleanup_object $DIR/gns_test_2h
cleanup_loop $LOOP_DEV $LOOP_FILE
cleanup_object $DIR/gns_test_2h
cleanup_loop $LOOP_DEV $LOOP_FILE
+ return 0
}
run_test 2h " odd conditions (mounting in background) ==================="