Statahead for remote objects is supposed to be disabled by
LU-11681 lmv: disable remote file statahead.
However due to typo it is not and statahead for remote objects is
accompanied by warnings like:
ll_set_inode()) Can not initialize inode .. without object type..
ll_prep_inode()) new_inode -fatal: rc -12
Fix the typo.
Test to illustrate the issue is added.
Fixes:
02b5a407081c ("LU-11681 lmv: disable remote file statahead")
Signed-off-by: Vladimir Saveliev <c17830@cray.com>
Cray-bug-id: LUS-8262
Change-Id: I8055b6373fb7b9777fa888dcb09384213822a59f
Reviewed-on: https://review.whamcloud.com/37089
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Olaf Faaland-LLNL <faaland1@llnl.gov>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
if (IS_ERR(ptgt))
RETURN(PTR_ERR(ptgt));
- ctgt = lmv_fid2tgt(lmv, &op_data->op_fid1);
+ ctgt = lmv_fid2tgt(lmv, &op_data->op_fid2);
if (IS_ERR(ctgt))
RETURN(PTR_ERR(ctgt));
#include <semaphore.h>
#include <time.h>
#include <err.h>
+#include <dirent.h>
#include <lustre/lustreapi.h>
" E[+|-] get lease. +/-: expect lease to (not) exist\n"
" f statfs\n"
" F print FID\n"
-" H[num] create HSM released file with num stripes\n"
" G gid get grouplock\n"
" g gid put grouplock\n"
+" H[num] create HSM released file with num stripes\n"
" K link path to filename\n"
" L link\n"
" l symlink filename to path\n"
" o open(O_RDONLY)\n"
" O open(O_CREAT|O_RDWR)\n"
" p print return value of last command\n"
+" Q open filename (should be dir), stat first entry to init statahead"
" r[num] read [optional length]\n"
" R reference entire mmap-ed region\n"
" s stat\n"
return size;
}
+static int statahead(char *dname)
+{
+ DIR *d;
+ struct dirent *dent;
+ struct stat st;
+ char *buf;
+ int rc;
+
+ rc = 0;
+ d = opendir(dname);
+ if (!d)
+ return errno;
+ dent = readdir(d);
+ if (!dent) {
+ rc = errno;
+ goto out_closedir;
+ }
+ if (asprintf(&buf, "%s/%s", dname, dent->d_name) == -1) {
+ rc = errno;
+ goto out_closedir;
+ }
+ if (stat(buf, &st))
+ rc = errno;
+ free(buf);
+out_closedir:
+ closedir(d);
+ return rc;
+}
+
#define POP_ARG() (pop_arg(argc, argv))
int main(int argc, char **argv)
case 'p':
printf("%lld\n", last_rc);
break;
+ case 'Q':
+ save_errno = statahead(fname);
+ if (save_errno) {
+ perror("statahead");
+ exit(save_errno);
+ }
+ break;
case 'r':
len = atoi(commands + 1);
if (len <= 0)
}
run_test 123b "not panic with network error in statahead enqueue (bug 15027)"
+test_123c() {
+ [[ $MDSCOUNT -lt 2 ]] && skip_env "needs >= 2 MDTs"
+
+ test_mkdir -i 0 -c 1 $DIR/$tdir.0
+ test_mkdir -i 1 -c 1 $DIR/$tdir.1
+ touch $DIR/$tdir.1/{1..3}
+ mv $DIR/$tdir.1/{1..3} $DIR/$tdir.0
+
+ remount_client $MOUNT
+
+ $MULTIOP $DIR/$tdir.0 Q
+
+ # let statahead to complete
+ ls -l $DIR/$tdir.0 > /dev/null
+
+ testid=$(echo $TESTNAME | tr '_' ' ')
+ dmesg | tac | sed "/$testid/,$ d" | grep "Can not initialize inode" &&
+ error "statahead warning" || true
+}
+run_test 123c "Can not initialize inode warning on DNE statahead"
+
test_124a() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"
$LCTL get_param -n mdc.*.connect_flags | grep -q lru_resize ||
check_node_health
check_dmesg_for_errors || error "Error in dmesg detected"
if [ "$PARALLEL" != "yes" ]; then
- ps auxww | grep -v grep | grep -q multiop &&
+ ps auxww | grep -v grep | grep -q "multiop " &&
error "multiop still running"
fi
unset TESTNAME