diff options
author | Amir Goldstein | 2018-03-15 22:39:01 +0100 |
---|---|---|
committer | Miklos Szeredi | 2018-04-12 12:04:48 +0200 |
commit | 695b46e76b62447e506cddc87e088236498008e5 (patch) | |
tree | 522f7a910302f5879915ebb19352632c4fdc1a5f /fs/isofs/compress.c | |
parent | Linux 4.16-rc7 (diff) | |
download | kernel-qcow2-linux-695b46e76b62447e506cddc87e088236498008e5.tar.gz kernel-qcow2-linux-695b46e76b62447e506cddc87e088236498008e5.tar.xz kernel-qcow2-linux-695b46e76b62447e506cddc87e088236498008e5.zip |
ovl: set i_ino to the value of st_ino for NFS export
Eddie Horng reported that readdir of an overlayfs directory that
was exported via NFSv3 returns entries with d_type set to DT_UNKNOWN.
The reason is that while preparing the response for readdirplus, nfsd
checks inside encode_entryplus_baggage() that a child dentry's inode
number matches the value of d_ino returns by overlayfs readdir iterator.
Because the overlayfs inodes use arbitrary inode numbers that are not
correlated with the values of st_ino/d_ino, NFSv3 falls back to not
encoding d_type. Although this is an allowed behavior, we can fix it for
the case of all overlayfs layers on the same underlying filesystem.
When NFS export is enabled and d_ino is consistent with st_ino
(samefs), set the same value also to i_ino in ovl_fill_inode() for all
overlayfs inodes, nfsd readdirplus sanity checks will pass.
ovl_fill_inode() may be called from ovl_new_inode(), before real inode
was created with ino arg 0. In that case, i_ino will be updated to real
upper inode i_ino on ovl_inode_init() or ovl_inode_update().
Reported-by: Eddie Horng <eddiehorng.tw@gmail.com>
Tested-by: Eddie Horng <eddiehorng.tw@gmail.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Fixes: 8383f1748829 ("ovl: wire up NFS export operations")
Cc: <stable@vger.kernel.org> #v4.16
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/isofs/compress.c')
0 files changed, 0 insertions, 0 deletions