madvise: Add locked-page check to MADV_REMOVE
Change-Id: I95465ef11aa4c772ad0ecf5d25f757192f31b93b refs: #1372
This commit is contained in:
@ -5368,6 +5368,11 @@ SYSCALL_DECLARE(madvise)
|
||||
}
|
||||
|
||||
if (advice == MADV_REMOVE) {
|
||||
if (range->flag & VR_LOCKED) {
|
||||
error = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!range->memobj || !memobj_is_removable(range->memobj)) {
|
||||
dkprintf("sys_madvise(%lx,%lx,%x):"
|
||||
"not removable [%lx-%lx)\n",
|
||||
|
||||
20
test/issues/1372/README
Normal file
20
test/issues/1372/README
Normal file
@ -0,0 +1,20 @@
|
||||
/* REDME COPYRIGHT FUJITSU LIMITED 2020 */
|
||||
|
||||
ltp: madvise02: MADV_REMOVEが期待通りに動作しない(2)
|
||||
https://postpeta.pccluster.org/redmine/issues/1372
|
||||
|
||||
テストセットREADME
|
||||
|
||||
(0) 事前準備
|
||||
1. $HOME/.mck_test_configを用意する
|
||||
|
||||
(1) テスト実行方法
|
||||
1. ./run.sh
|
||||
|
||||
(2) テスト項目詳細
|
||||
|
||||
LTPの下記項目を実行し期待通りに動作することを確認する
|
||||
"test OK." が書き出されれば合格判定となる。具体例はresult.logを参照。
|
||||
- madvise02
|
||||
|
||||
以上。
|
||||
27
test/issues/1372/result.log
Normal file
27
test/issues/1372/result.log
Normal file
@ -0,0 +1,27 @@
|
||||
[root@hostname 1372]# ./run.sh
|
||||
mcstop+release.sh ... done
|
||||
mcreboot.sh -c 12-59 -m 512M@4 ... done
|
||||
test run.
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
madvise02.c:189: PASS: MADV_NORMAL failed as expected: EINVAL
|
||||
madvise02.c:189: PASS: MADV_NORMAL failed as expected: EINVAL
|
||||
madvise02.c:189: PASS: MADV_REMOVE failed as expected: EINVAL
|
||||
madvise02.c:189: PASS: MADV_DONTNEED failed as expected: EINVAL
|
||||
madvise02.c:182: CONF: MADV_MERGEABLE is not supported
|
||||
madvise02.c:182: CONF: MADV_UNMERGEABLE is not supported
|
||||
madvise02.c:189: PASS: MADV_NORMAL failed as expected: ENOMEM
|
||||
madvise02.c:189: PASS: MADV_WILLNEED failed as expected: ENOMEM
|
||||
madvise02.c:182: CONF: MADV_WILLNEED is not supported
|
||||
madvise02.c:189: PASS: MADV_FREE failed as expected: EINVAL
|
||||
madvise02.c:189: PASS: MADV_WIPEONFORK failed as expected: EINVAL
|
||||
madvise02.c:189: PASS: MADV_WIPEONFORK shared_anon failed as expected: EINVAL
|
||||
madvise02.c:189: PASS: MADV_WIPEONFORK private file backed failed as expected: EINVAL
|
||||
|
||||
Summary:
|
||||
passed 10
|
||||
failed 0
|
||||
skipped 3
|
||||
warnings 0
|
||||
tst_tmpdir.c:330: WARN: tst_rmdir: rmobj(/tmp/Ql3dOH) failed: remove(/tmp/Ql3dOH) failed; errno=39: ENOTEMPTY
|
||||
test OK.
|
||||
mcstop+release.sh ... done
|
||||
31
test/issues/1372/run.sh
Executable file
31
test/issues/1372/run.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
# run.sh COPYRIGHT FUJITSU LIMITED 2020
|
||||
|
||||
# load setting and booting mck.
|
||||
USELTP=1
|
||||
. ../../common.sh
|
||||
chmod 777 /dev/mcos*
|
||||
|
||||
echo "test run."
|
||||
ltp=`cat <<__EOL__
|
||||
madvise02
|
||||
__EOL__`
|
||||
|
||||
FAIL=0
|
||||
for tp in $ltp
|
||||
do
|
||||
pushd ${LTPBIN} > /dev/null
|
||||
${MCEXEC} ${LTPBIN}/${tp}
|
||||
if [ $? -ne 0 ]; then
|
||||
FAIL=1
|
||||
fi
|
||||
popd > /dev/null
|
||||
done
|
||||
|
||||
if [ ${FAIL} -eq 1 ]; then
|
||||
echo "test NG."
|
||||
else
|
||||
echo "test OK."
|
||||
fi
|
||||
|
||||
mcstop
|
||||
Reference in New Issue
Block a user