madvise: Support MADV_REMOVE on tmpfs
Change-Id: Ic99d374c4d2630944c7bc838937d7f45601783c6 refs: #1371
This commit is contained in:
@ -974,6 +974,10 @@ static int pager_req_create(ihk_os_t os, int fd, uintptr_t result_pa)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!strcmp(inode->i_sb->s_type->name, "tmpfs")) {
|
||||
mf_flags = MF_IS_REMOVABLE;
|
||||
}
|
||||
|
||||
if (!strcmp(inode->i_sb->s_type->name, "proc")) {
|
||||
error = -ESRCH;
|
||||
goto out;
|
||||
|
||||
20
test/issues/1371/README
Normal file
20
test/issues/1371/README
Normal file
@ -0,0 +1,20 @@
|
||||
/* REDME COPYRIGHT FUJITSU LIMITED 2020 */
|
||||
|
||||
ltp: madvise01: MADV_REMOVEが期待通りに動作しない
|
||||
https://postpeta.pccluster.org/redmine/issues/1371
|
||||
|
||||
テストセットREADME
|
||||
|
||||
(0) 事前準備
|
||||
1. $HOME/.mck_test_configを用意する
|
||||
|
||||
(1) テスト実行方法
|
||||
1. ./run.sh
|
||||
|
||||
(2) テスト項目詳細
|
||||
|
||||
LTPの下記項目を実行し期待通りに動作することを確認する
|
||||
"test OK." が書き出されれば合格判定となる。具体例はresult.logを参照。
|
||||
- madvise01
|
||||
|
||||
以上。
|
||||
35
test/issues/1371/result.log
Normal file
35
test/issues/1371/result.log
Normal file
@ -0,0 +1,35 @@
|
||||
[root@hostname 1371]# ./run.sh
|
||||
mcstop+release.sh ... done
|
||||
mcreboot.sh -c 12-59 -m 512M@4 ... done
|
||||
test run.
|
||||
Script started, file is tmp.dCXi5LtX9k
|
||||
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
|
||||
madvise01.c:121: PASS: madvise test for MADV_NORMAL PASSED
|
||||
madvise01.c:121: PASS: madvise test for MADV_RANDOM PASSED
|
||||
madvise01.c:121: PASS: madvise test for MADV_SEQUENTIAL PASSED
|
||||
madvise01.c:121: PASS: madvise test for MADV_WILLNEED PASSED
|
||||
madvise01.c:121: PASS: madvise test for MADV_DONTNEED PASSED
|
||||
madvise01.c:121: PASS: madvise test for MADV_REMOVE PASSED
|
||||
madvise01.c:121: PASS: madvise test for MADV_DONTFORK PASSED
|
||||
madvise01.c:121: PASS: madvise test for MADV_DOFORK PASSED
|
||||
madvise01.c:118: FAIL: madvise test for MADV_HWPOISON failed with return = -1, errno = 1 : ???
|
||||
madvise01.c:113: CONF: MADV_MERGEABLE is not supported
|
||||
madvise01.c:113: CONF: MADV_UNMERGEABLE is not supported
|
||||
madvise01.c:118: FAIL: madvise test for MADV_HUGEPAGE failed with return = -1, errno = 9 : ???
|
||||
madvise01.c:118: FAIL: madvise test for MADV_NOHUGEPAGE failed with return = -1, errno = 9 : ???
|
||||
madvise01.c:121: PASS: madvise test for MADV_DONTDUMP PASSED
|
||||
madvise01.c:121: PASS: madvise test for MADV_DODUMP PASSED
|
||||
madvise01.c:113: CONF: MADV_FREE is not supported
|
||||
madvise01.c:121: PASS: madvise test for MADV_WIPEONFORK PASSED
|
||||
madvise01.c:121: PASS: madvise test for MADV_KEEPONFORK PASSED
|
||||
safe_macros.c:773: WARN: madvise01.c:102: umount(tmp_madvise) failed: EBUSY
|
||||
|
||||
Summary:
|
||||
passed 12
|
||||
failed 3
|
||||
skipped 3
|
||||
warnings 1
|
||||
tst_tmpdir.c:330: WARN: tst_rmdir: rmobj(/tmp/EEcwqf) failed: remove(/tmp/EEcwqf/tmp_madvise) failed; errno=16: EBUSY
|
||||
Script done, file is tmp.dCXi5LtX9k
|
||||
test OK.
|
||||
mcstop+release.sh ... done
|
||||
47
test/issues/1371/run.sh
Executable file
47
test/issues/1371/run.sh
Executable file
@ -0,0 +1,47 @@
|
||||
#!/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."
|
||||
FAIL=0
|
||||
|
||||
pushd ${LTPBIN} > /dev/null
|
||||
|
||||
temp_log=`mktemp tmp.XXXXXXXXXX`
|
||||
script -f -c "${MCEXEC} ${LTPBIN}/madvise01" ${temp_log}
|
||||
|
||||
passed=`cat <<__EOL__
|
||||
MADV_NORMAL
|
||||
MADV_RANDOM
|
||||
MADV_SEQUENTIAL
|
||||
MADV_WILLNEED
|
||||
MADV_DONTNEED
|
||||
MADV_REMOVE
|
||||
MADV_DONTFORK
|
||||
MADV_DOFORK
|
||||
MADV_DONTDUMP
|
||||
MADV_DODUMP
|
||||
MADV_WIPEONFORK
|
||||
MADV_KEEPONFORK
|
||||
__EOL__`
|
||||
for madv in $passed
|
||||
do
|
||||
grep "$madv" "${temp_log}" | grep -q "PASS:"
|
||||
if [ $? -ne 0 ]; then
|
||||
FAIL=1
|
||||
fi
|
||||
done
|
||||
|
||||
rm -f "$temp_log"
|
||||
|
||||
if [ ${FAIL} -eq 1 ]; then
|
||||
echo "test NG."
|
||||
else
|
||||
echo "test OK."
|
||||
fi
|
||||
|
||||
mcstop
|
||||
Reference in New Issue
Block a user