linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [linus:master] [pidfd]  cb12fd8e0d: ltp.readahead01.fail
@ 2024-03-15  8:16 kernel test robot
  2024-03-15 13:42 ` Christian Brauner
  0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2024-03-15  8:16 UTC (permalink / raw)
  To: Christian Brauner
  Cc: oe-lkp, lkp, linux-kernel, linux-fsdevel, ltp, oliver.sang



Hello,

kernel test robot noticed "ltp.readahead01.fail" on:

commit: cb12fd8e0dabb9a1c8aef55a6a41e2c255fcdf4b ("pidfd: add pidfs")
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master

[test failed on linus/master 65d287c7eb1d14e0f4d56f19cec30d97fc7e8f66]
[test failed on linux-next/master a1184cae56bcb96b86df3ee0377cec507a3f56e0]

in testcase: ltp
version: ltp-x86_64-14c1f76-1_20240309
with following parameters:

	disk: 1HDD
	fs: f2fs
	test: syscalls-00/readahead01



compiler: gcc-12
test machine: 4 threads 1 sockets Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz (Ivy Bridge) with 8G memory

(please refer to attached dmesg/kmsg for entire log/backtrace)




If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <oliver.sang@intel.com>
| Closes: https://lore.kernel.org/oe-lkp/202403151507.5540b773-oliver.sang@intel.com



Running tests.......
<<<test_start>>>
tag=readahead01 stime=1710262698
cmdline="readahead01"
contacts=""
analysis=exit
<<<test_output>>>
tst_test.c:1741: TINFO: LTP version: 20240129-91-gcbc2d0568
tst_test.c:1625: TINFO: Timeout per run is 0h 02m 30s
readahead01.c:36: TPASS: readahead() with fd = -1 : EBADF (9)
readahead01.c:43: TPASS: readahead() with invalid fd : EBADF (9)
readahead01.c:63: TPASS: readahead() on O_PATH file : EBADF (9)
readahead01.c:63: TPASS: readahead() on directory : EINVAL (22)
readahead01.c:63: TPASS: readahead() on /dev/zero : EINVAL (22)
readahead01.c:63: TPASS: readahead() on pipe read end : EINVAL (22)
readahead01.c:63: TPASS: readahead() on pipe write end : EBADF (9)
readahead01.c:63: TPASS: readahead() on unix socket : EINVAL (22)
readahead01.c:63: TPASS: readahead() on inet socket : EINVAL (22)
readahead01.c:63: TPASS: readahead() on epoll : EINVAL (22)
readahead01.c:63: TPASS: readahead() on eventfd : EINVAL (22)
readahead01.c:63: TPASS: readahead() on signalfd : EINVAL (22)
readahead01.c:63: TPASS: readahead() on timerfd : EINVAL (22)
readahead01.c:63: TFAIL: readahead() on pidfd succeeded
readahead01.c:63: TPASS: readahead() on fanotify : EINVAL (22)
readahead01.c:63: TPASS: readahead() on inotify : EINVAL (22)
readahead01.c:63: TPASS: readahead() on userfaultfd : EINVAL (22)
readahead01.c:63: TPASS: readahead() on perf event : EINVAL (22)
readahead01.c:63: TPASS: readahead() on io uring : EINVAL (22)
readahead01.c:63: TPASS: readahead() on bpf map : EINVAL (22)
readahead01.c:63: TPASS: readahead() on fsopen : EINVAL (22)
readahead01.c:63: TPASS: readahead() on fspick : EINVAL (22)
readahead01.c:63: TPASS: readahead() on open_tree : EBADF (9)

Summary:
passed   22
failed   1
broken   0
skipped  0
warnings 0
incrementing stop
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=1 corefile=no
cutime=0 cstime=3
<<<test_end>>>
INFO: ltp-pan reported some tests FAIL
LTP Version: 20240129-91-gcbc2d0568

       ###############################################################

            Done executing testcases.
            LTP Version:  20240129-91-gcbc2d0568
       ###############################################################




The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20240315/202403151507.5540b773-oliver.sang@intel.com



-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linus:master] [pidfd]  cb12fd8e0d: ltp.readahead01.fail
  2024-03-15  8:16 [linus:master] [pidfd] cb12fd8e0d: ltp.readahead01.fail kernel test robot
@ 2024-03-15 13:42 ` Christian Brauner
  2024-03-15 14:49   ` [LTP] " Cyril Hrubis
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Brauner @ 2024-03-15 13:42 UTC (permalink / raw)
  To: kernel test robot; +Cc: oe-lkp, lkp, linux-kernel, linux-fsdevel, ltp

On Fri, Mar 15, 2024 at 04:16:33PM +0800, kernel test robot wrote:
> 
> 
> Hello,
> 
> kernel test robot noticed "ltp.readahead01.fail" on:
> 
> commit: cb12fd8e0dabb9a1c8aef55a6a41e2c255fcdf4b ("pidfd: add pidfs")
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
> 
> [test failed on linus/master 65d287c7eb1d14e0f4d56f19cec30d97fc7e8f66]
> [test failed on linux-next/master a1184cae56bcb96b86df3ee0377cec507a3f56e0]
> 
> in testcase: ltp
> version: ltp-x86_64-14c1f76-1_20240309
> with following parameters:
> 
> 	disk: 1HDD
> 	fs: f2fs
> 	test: syscalls-00/readahead01
> 
> 
> 
> compiler: gcc-12
> test machine: 4 threads 1 sockets Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz (Ivy Bridge) with 8G memory

Yes, this is an expected failure.
Before moving pidfds to pidfs they were based on anonymous inodes.
Anonymous inodes have a strange property: yhey have no file type. IOW,
(stat.st_mode & S_IFMT) == 0.

The readhead code looks at the filetype and if it isn't a regular file
then you'll get EINVAL. This is the case for anonymous inode based
pidfds:

        /*
         * The readahead() syscall is intended to run only on files
         * that can execute readahead. If readahead is not possible
         * on this file, then we must return -EINVAL.
         */
        ret = -EINVAL;
        if (!f.file->f_mapping || !f.file->f_mapping->a_ops ||
            (!S_ISREG(file_inode(f.file)->i_mode) &&
            !S_ISBLK(file_inode(f.file)->i_mode)))
                goto out;

However, pidfs makes them regular files so they're not caught by that
check anymore.

However, pidfs doesn't implement any readahead support. Specifically,
it'll have sb->s_bdi == noop_backing_dev_info. Which will mean the
readahead request is just ignored:

        if (IS_DAX(inode) || (bdi == &noop_backing_dev_info)) {
                switch (advice) {
                case POSIX_FADV_NORMAL:
                case POSIX_FADV_RANDOM:
                case POSIX_FADV_SEQUENTIAL:
                case POSIX_FADV_WILLNEED:
                case POSIX_FADV_NOREUSE:
                case POSIX_FADV_DONTNEED:
                        /* no bad return value, but ignore advice */
                        break;
                default:
                        return -EINVAL;
                }
                return 0;
        }

So I'd just remove that test. It's meaningless for pseudo fses.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [LTP] [linus:master] [pidfd]  cb12fd8e0d: ltp.readahead01.fail
  2024-03-15 13:42 ` Christian Brauner
@ 2024-03-15 14:49   ` Cyril Hrubis
  2024-03-18  8:47     ` Christian Brauner
  0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2024-03-15 14:49 UTC (permalink / raw)
  To: Christian Brauner
  Cc: kernel test robot, oe-lkp, linux-fsdevel, lkp, ltp, linux-kernel

Hi!
> So I'd just remove that test. It's meaningless for pseudo fses.

Wouldn't it make more sense to actually return EINVAL instead of
ignoring the request if readahead() is not implemented?

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [LTP] [linus:master] [pidfd]  cb12fd8e0d: ltp.readahead01.fail
  2024-03-15 14:49   ` [LTP] " Cyril Hrubis
@ 2024-03-18  8:47     ` Christian Brauner
  2024-04-23 13:52       ` Petr Vorel
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Brauner @ 2024-03-18  8:47 UTC (permalink / raw)
  To: Cyril Hrubis
  Cc: kernel test robot, oe-lkp, linux-fsdevel, lkp, ltp, linux-kernel

On Fri, Mar 15, 2024 at 03:49:03PM +0100, Cyril Hrubis wrote:
> Hi!
> > So I'd just remove that test. It's meaningless for pseudo fses.
> 
> Wouldn't it make more sense to actually return EINVAL instead of
> ignoring the request if readahead() is not implemented?

It would change the return value for a whole bunch of stuff. I'm not
sure that wouldn't cause regressions but is in any case a question for
the readahead maintainers. For now I'd just remove that test for pidfds
imho.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [LTP] [linus:master] [pidfd]  cb12fd8e0d: ltp.readahead01.fail
  2024-03-18  8:47     ` Christian Brauner
@ 2024-04-23 13:52       ` Petr Vorel
  0 siblings, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2024-04-23 13:52 UTC (permalink / raw)
  To: Christian Brauner
  Cc: Cyril Hrubis, lkp, linux-kernel, linux-fsdevel, kernel test robot,
	oe-lkp, ltp, linux-mm, Matthew Wilcox (Oracle), Andrew Morton

Hi,

> On Fri, Mar 15, 2024 at 03:49:03PM +0100, Cyril Hrubis wrote:
> > Hi!
> > > So I'd just remove that test. It's meaningless for pseudo fses.

> > Wouldn't it make more sense to actually return EINVAL instead of
> > ignoring the request if readahead() is not implemented?

> It would change the return value for a whole bunch of stuff. I'm not
> sure that wouldn't cause regressions but is in any case a question for
> the readahead maintainers. For now I'd just remove that test for pidfds
> imho.

@Matthew, any input on Cyril's question please?

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-04-23 13:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-15  8:16 [linus:master] [pidfd] cb12fd8e0d: ltp.readahead01.fail kernel test robot
2024-03-15 13:42 ` Christian Brauner
2024-03-15 14:49   ` [LTP] " Cyril Hrubis
2024-03-18  8:47     ` Christian Brauner
2024-04-23 13:52       ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).