ovl: support stacked SEEK_HOLE/SEEK_DATA
authorAmir Goldstein <amir73il@gmail.com>
Wed, 27 Feb 2019 11:32:11 +0000 (13:32 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Mon, 6 May 2019 11:54:51 +0000 (13:54 +0200)
commit9e46b840c7053b5f7a245e98cd239b60d189a96c
tree802b84ae86ddae6b08875cc7d219995e618214ff
parent3428030da004a1128cbdcf93dc03e16f184d845b
ovl: support stacked SEEK_HOLE/SEEK_DATA

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>
fs/overlayfs/file.c