linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] iov_iter: separate direction from flavour
@ 2021-07-04 17:29 Guenter Roeck
  2021-07-04 18:31 ` Linus Torvalds
  0 siblings, 1 reply; 12+ messages in thread
From: Guenter Roeck @ 2021-07-04 17:29 UTC (permalink / raw)
  To: Al Viro
  Cc: Linus Torvalds, linux-fsdevel, linux-kernel, David Sterba,
	Miklos Szeredi, Anton Altaparmakov, David Howells,
	Matthew Wilcox, Pavel Begunkov

Hi,

On Thu, Apr 22, 2021 at 02:50:39PM -0400, Al Viro wrote:
> Instead of having them mixed in iter->type, use separate ->iter_type
> and ->data_source (u8 and bool resp.)  And don't bother with (pseudo-)
> bitmap for the former - microoptimizations from being able to check
> if the flavour is one of two values are not worth the confusion for
> optimizer.  It can't prove that we never get e.g. ITER_IOVEC | ITER_PIPE,
> so we end up with extra headache.
> 
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

This patch results in the following runtime warning on nommu systems.

[    8.567154] Run /init as init process
[    8.572112] ------------[ cut here ]------------
[    8.572248] WARNING: CPU: 0 PID: 1 at lib/iov_iter.c:468 iov_iter_init+0x35/0x58
[    8.572484] CPU: 0 PID: 1 Comm: init Not tainted 5.13.0-09606-g303392fd5c16 #1
[    8.572695] Hardware name: MPS2 (Device Tree Support)
[    8.573278] [<2100ae75>] (unwind_backtrace) from [<2100a2bb>] (show_stack+0xb/0xc)
[    8.573594] [<2100a2bb>] (show_stack) from [<2100da03>] (__warn+0x5f/0x80)
[    8.573738] [<2100da03>] (__warn) from [<2100da55>] (warn_slowpath_fmt+0x31/0x60)
[    8.573886] [<2100da55>] (warn_slowpath_fmt) from [<210d8e1d>] (iov_iter_init+0x35/0x58)
[    8.574044] [<210d8e1d>] (iov_iter_init) from [<21059cab>] (vfs_read+0x89/0xc6)
[    8.574191] [<21059cab>] (vfs_read) from [<2105d92b>] (read_code+0x15/0x2e)
[    8.574329] [<2105d92b>] (read_code) from [<21085a8d>] (load_flat_file+0x341/0x4f0)
[    8.574481] [<21085a8d>] (load_flat_file) from [<21085e03>] (load_flat_binary+0x47/0x2dc)
[    8.574639] [<21085e03>] (load_flat_binary) from [<2105d581>] (bprm_execve+0x1fd/0x32c)
[    8.574797] [<2105d581>] (bprm_execve) from [<2105dbb3>] (kernel_execve+0xa3/0xac)
[    8.574947] [<2105dbb3>] (kernel_execve) from [<211e7095>] (kernel_init+0x31/0xb0)
[    8.575099] [<211e7095>] (kernel_init) from [<2100814d>] (ret_from_fork+0x11/0x24)
[    8.575287] Exception stack(0x21429fb0 to 0x21429ff8)
[    8.575433] 9fa0:                                     00000000 00000000 00000000 00000000
[    8.575593] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    8.575743] 9fe0: 00000000 00000000 00000000 00000000 00000000 00000000
[    8.575933] ---[ end trace ba15568c05035a77 ]---

This is with qemu's mps2-an385 emulation and and mps2_defconfig.
The same warning is also observed with m68k and mcf5208evb,
though the traceback isn't as nice.

WARNING: CPU: 0 PID: 1 at lib/iov_iter.c:468 0x40135e4e
...
Call Trace:
        [<402b0f42>] 0x402b0f42
 [<402b0fea>] 0x402b0fea
 [<40135e4e>] 0x40135e4e
 [<40135e4e>] 0x40135e4e
 [<4009c610>] 0x4009c610
...

Reverting this patch fixes the problem for both mps2-an385 and mcf5208evb.

Guenter

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

end of thread, other threads:[~2021-07-05  5:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-04 17:29 [PATCH] iov_iter: separate direction from flavour Guenter Roeck
2021-07-04 18:31 ` Linus Torvalds
2021-07-04 18:54   ` Guenter Roeck
2021-07-04 19:04     ` Linus Torvalds
2021-07-04 20:28       ` Guenter Roeck
2021-07-04 20:41         ` Linus Torvalds
2021-07-04 21:47           ` Guenter Roeck
2021-07-04 22:44             ` Linus Torvalds
2021-07-04 22:47               ` Matthew Wilcox
2021-07-04 22:53                 ` Linus Torvalds
2021-07-04 23:34                   ` Linus Torvalds
2021-07-05  5:17           ` Christoph Hellwig

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).