]> git.baikalelectronics.ru Git - kernel.git/commit
ovl: fix IOCB_DIRECT if underlying fs doesn't support direct IO
authorMiklos Szeredi <mszeredi@redhat.com>
Mon, 27 Sep 2021 09:23:57 +0000 (11:23 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Tue, 28 Sep 2021 07:16:12 +0000 (09:16 +0200)
commit10aca23f5cf9c4d9a5f586da802a38d3bb5a7158
treebdd3994a59af1aadf9552c99516cd2f6cd994302
parentbe00824777f304c8dfc7a73eebc28dcb0b3b1a5c
ovl: fix IOCB_DIRECT if underlying fs doesn't support direct IO

Normally the check at open time suffices, but e.g loop device does set
IOCB_DIRECT after doing its own checks (which are not sufficent for
overlayfs).

Make sure we don't call the underlying filesystem read/write method with
the IOCB_DIRECT if it's not supported.

Reported-by: Huang Jianan <huangjianan@oppo.com>
Fixes: c7e49d8d6568 ("ovl: add ovl_read_iter()")
Cc: <stable@vger.kernel.org> # v4.19
Tested-by: Huang Jianan <huangjianan@oppo.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/file.c