Do not flush COW pages from an executable mapping, as this will cause
running binaries to segfault when mapped pages disappear under them.
This was modified to allow non-blocking PCC caching, but triggers
immediate segfaults for binaries when the DLM locks are revoked, even
when PCC is not in use.
The added test case failed 100% without this patch.
This patch is only a partial fix to avoid the segfaults. There still
needs to be something done to re-introduce the PCC functionality, but
should be conditional on PCC enabled, and not for running binaries.
There is a problem for PCC when multiple clients read/write on a
shared mmapped file. We exclude mmap_sanity tst6 in test_4 from
PCC testing temporarily.
Test-Parameters: testlist=sanity envdefinitions=ONLY=30d
Test-Parameters: testlist=sanity envdefinitions=ONLY=30d
Test-Parameters: testlist=sanity envdefinitions=ONLY=30d
Fixes:
58d744e3eaab ("LU-10092 pcc: Non-blocking PCC caching")
Change-Id: I7084e1db1f0f29cb0237b619abd33ca556aa7ec7
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/37278
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
Reviewed-by: Stephan Thiell <sthiell@stanford.edu>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
if (mapping_mapped(mapping)) {
rc = 0;
unmap_mapping_range(mapping, first + PAGE_SIZE - 1,
- last - first + 1, 1);
+ last - first + 1, 0);
}
RETURN(rc);
* This operation is expensive but mmap processes have to pay
* a price themselves. */
unmap_mapping_range(conf->coc_inode->i_mapping,
- 0, OBD_OBJECT_EOF, 1);
+ 0, OBD_OBJECT_EOF, 0);
pcc_layout_invalidate(conf->coc_inode);
}
return 0;
# mmap_sanity tst7 failed on the local ext4 filesystem.
# It seems that Lustre filesystem does special process for tst 7.
# Thus, we exclude tst7 from the PCC testing.
- $LUSTRE/tests/mmap_sanity -d $DIR/$tdir -m $DIR2/$tdir -e 7 ||
+ # There is a mmap problem for PCC when multiple clients read/write
+ # on a shared mmapped file. Thus, we exclude mmap_sanity tst6 from
+ # the PCC tesing.
+ $LUSTRE/tests/mmap_sanity -d $DIR/$tdir -m $DIR2/$tdir -e 6 -e 7 ||
error "mmap_sanity test failed"
sync; sleep 1; sync
test_30c() { # b=22376
[ $PARALLEL == "yes" ] && skip "skip parallel run"
- cp `which ls` $DIR || cp /bin/ls $DIR
+ cp $(which ls) $DIR || cp /bin/ls $DIR
chmod a-rw $DIR/ls
cancel_lru_locks mdc
cancel_lru_locks osc
}
run_test 30c "execute binary from Lustre without read perms ===="
+test_30d() {
+ cp $(which dd) $DIR || error "failed to copy dd to $DIR/dd"
+
+ for i in {1..10}; do
+ $DIR/dd bs=1M count=128 if=/dev/zero of=$DIR/$tfile &
+ local PID=$!
+ sleep 1
+ $LCTL set_param ldlm.namespaces.*MDT*.lru_size=clear
+ wait $PID || error "executing dd from Lustre failed"
+ rm -f $DIR/$tfile
+ done
+
+ rm -f $DIR/dd
+}
+run_test 30d "execute binary from Lustre while clear locks"
+
test_31a() {
$OPENUNLINK $DIR/f31 $DIR/f31 || error "openunlink failed"
$CHECKSTAT -a $DIR/f31 || error "$DIR/f31 exists"