}
+static int ll_rd_client_type(char *page, char **start, off_t off, int count,
+ int *eof, void *data)
+{
+ struct ll_sb_info *sbi = ll_s2sbi((struct super_block *)data);
+ int rc;
+
+ LASSERT(sbi != NULL);
+
+ *eof = 1;
+ if (sbi->ll_flags & LL_SBI_RMT_CLIENT)
+ rc = snprintf(page, count, "remote client\n");
+ else
+ rc = snprintf(page, count, "local client\n");
+
+ return rc;
+}
+
static int ll_rd_fstype(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
{ "kbytesavail", ll_rd_kbytesavail, 0, 0 },
{ "filestotal", ll_rd_filestotal, 0, 0 },
{ "filesfree", ll_rd_filesfree, 0, 0 },
+ { "client_type", ll_rd_client_type, 0, 0 },
//{ "filegroups", lprocfs_rd_filegroups, 0, 0 },
{ "max_read_ahead_mb", ll_rd_max_readahead_mb,
ll_wr_max_readahead_mb, 0 },
run_one() {
BEFORE=`date +%s`
- log "== test $2= `date +%H:%M:%S` ($BEFORE)"
+ log "== test $1 $2= `date +%H:%M:%S` ($BEFORE)"
export TESTNAME=test_$1
test_$1 || error "exit with rc=$?"
unset TESTNAME
ROOTSQUASH_GID=$LPROC/mdt/$MDT/rootsquash_gid
NOSQUASH_NIDS=$LPROC/mdt/$MDT/nosquash_nids
KRB5_REALM=`cat /etc/krb5.conf |grep default_realm| awk '{ print $3 }'`
+CLIENT_TYPE=$LPROC/llite/*/client_type
USER1=`cat /etc/passwd|grep :500:|cut -d: -f1`
USER2=`cat /etc/passwd|grep :501:|cut -d: -f1`
+grep "local client" $CLIENT_TYPE > /dev/null 2>&1 && EXCEPT="$EXCEPT 2"
+
if [ ! "$USER1" ]
then
echo "==========Please add user1 (uid=500)!=========="
rm -f $SETXID_CONF_BAK
fi
echo $ENABLE_IDENTITY > $IDENTITY_UPCALL
- echo 1 > $IDENTITY_FLUSH
+ echo -1 > $IDENTITY_FLUSH
$RUNAS -u 500 ls $DIR
$RUNAS -u 501 ls $DIR
}
$RUNAS -u 501 -v 500 touch $DIR/d1/f0 && error
echo "* 501 setuid" > $SETXID_CONF
echo "enable uid 501 setuid"
- echo 1 > $IDENTITY_FLUSH
+ echo -1 > $IDENTITY_FLUSH
$RUNAS -u 501 -v 500 touch $DIR/d1/f1 || error
chown root $DIR/d1
$RUNAS -u 501 -g 501 touch $DIR/d1/f2 && error
echo "* 501 setuid,setgid" > $SETXID_CONF
echo "enable uid 501 setuid,setgid"
- echo 1 > $IDENTITY_FLUSH
+ echo -1 > $IDENTITY_FLUSH
$RUNAS -u 501 -g 501 -j 500 touch $DIR/d1/f3 || error
$RUNAS -u 501 -v 500 -g 501 -j 500 touch $DIR/d1/f4 || error
rm -f $SETXID_CONF
rm -rf $DIR/d1
- echo 1 > $IDENTITY_FLUSH
+ echo -1 > $IDENTITY_FLUSH
}
run_test 1 "setuid/gid ============================="
mv -f $SETXID_CONF_BAK $SETXID_CONF
fi
echo $IDENTITY_UPCALL_BAK > $IDENTITY_UPCALL
- echo 1 > $IDENTITY_FLUSH
+ echo -1 > $IDENTITY_FLUSH
$RUNAS -u 500 ls $DIR
$RUNAS -u 501 ls $DIR
}