]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ovl: support stacked SEEK_HOLE/SEEK_DATA
authorAmir Goldstein <amir73il@gmail.com>
Wed, 27 Feb 2019 11:32:11 +0000 (13:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Jun 2019 09:54:11 +0000 (11:54 +0200)
commitafec706807cd326ab2a5e4d08162cda98eb495a0
treeac3f725e85620be7c0749b9b1538549fb8618249
parent22dac6cc9549fec8ceb82ec1cc6da24a9f5a6705
ovl: support stacked SEEK_HOLE/SEEK_DATA

commit 9e46b840c7053b5f7a245e98cd239b60d189a96c upstream.

Overlay file f_pos is the master copy that is preserved
through copy up and modified on read/write, but only real
fs knows how to SEEK_HOLE/SEEK_DATA and real fs may impose
limitations that are more strict than ->s_maxbytes for specific
files, so we use the real file to perform seeks.

We do not call real fs for SEEK_CUR:0 query and for SEEK_SET:0
requests.

Fixes: d1d04ef8572b ("ovl: stack file ops")
Reported-by: Eddie Horng <eddiehorng.tw@gmail.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/overlayfs/file.c