From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yang Xu Date: Tue, 30 Jul 2019 16:31:34 +0800 Subject: [LTP] [PATCH v6 2/3] syscalls/copy_file_range01: add cross-device test In-Reply-To: <20190729141011.GA1965@dell5510> References: <5D30200B.4050306@cn.fujitsu.com> <1564030915-3211-1-git-send-email-xuyang2018.jy@cn.fujitsu.com> <1564030915-3211-2-git-send-email-xuyang2018.jy@cn.fujitsu.com> <20190729140043.GB31077@dell5510> <20190729141011.GA1965@dell5510> Message-ID: <5D400066.2090204@cn.fujitsu.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ltp@lists.linux.it > Hi, > >>> Amir has relaxed cross-device constraint since commit[1], I think we can test it in >>> copy_file_range01. >>> [1]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5dae222a5 >>> Signed-off-by: Yang Xu >>> Reviewed-by: Amir Goldstein >> Now sent to the correct patchset version: >> Whole patchset LGTM, but here we got quite a lot of failures after increasing >> test coverage with .all_filesystems = 1 (which use should be noted in commit >> message): >> copy_file_range02.c:120: FAIL: copy_file_range failed unexpectedly; expected EOVERFLOW, but got: EINVAL >> copy_file_range02.c:126: FAIL: copy_file_range returned wrong value: 16 >> ... >> copy_file_range02.c:126: FAIL: copy_file_range returned wrong value: 16 Hi Petr can you give more information? such as distros, filesystem, envrionment, do you get 16(EBUSY) on all filesystems? Because on my machine, I get the following result on 4.18.0-80.el8.x86_64(I test on vfat, extN,xfs,btrfs). copy_file_range02.c:118: PASS: copy_file_range failed as expected: EBADF copy_file_range02.c:118: PASS: copy_file_range failed as expected: EISDIR copy_file_range02.c:118: PASS: copy_file_range failed as expected: EBADF copy_file_range02.c:118: PASS: copy_file_range failed as expected: EBADF copy_file_range02.c:118: PASS: copy_file_range failed as expected: EINVAL copy_file_range02.c:127: FAIL: copy_file_range returned wrong value: 32 copy_file_range02.c:127: FAIL: copy_file_range returned wrong value: 0 copy_file_range02.c:127: FAIL: copy_file_range returned wrong value: 0 copy_file_range02.c:118: PASS: copy_file_range failed as expected: EINVAL copy_file_range02.c:118: PASS: copy_file_range failed as expected: EINVAL copy_file_range02.c:118: PASS: copy_file_range failed as expected: EINVAL copy_file_range02.c:122: FAIL: copy_file_range failed unexpectedly; expected EOVERFLOW, but got: EINVAL copy_file_range02.c:127: FAIL: copy_file_range returned wrong value: 0 > Also .mount_device = 1 and .all_filesystems = 1 require > .needs_root = 1 definition or you get > > tst_device.c:97: INFO: Not allowed to open /dev/loop-control. Are you root?: EACCES > tst_device.c:132: INFO: No free devices found > tst_device.c:308: BROK: Failed to acquire device > > BTW I wonder whether these could be detected automatically. Here needs root because /dev/loop-control needs it. But it doesn't represent mount_device and all_filesystems need root. Or, I misunderstand your idea? > Kind regards, > Petr > > > . >