[ Sasha's backport helper bot ]
Hi,
The upstream commit SHA1 provided is correct: 07aeefae7ff44d80524375253980b1bdee2396b0
Status in newer kernel trees: 6.12.y | Present (different SHA1: 668d8dea2cee) 6.6.y | Present (different SHA1: a3f8a2b13a27)
Note: The patch differs from the upstream commit: --- 1: 07aeefae7ff44 ! 1: 8f1f4e6b34fc1 ovl: pass realinode to ovl_encode_real_fh() instead of realdentry @@ Metadata ## Commit message ## ovl: pass realinode to ovl_encode_real_fh() instead of realdentry
+ [ Upstream commit 07aeefae7ff44d80524375253980b1bdee2396b0 ] + We want to be able to encode an fid from an inode with no alias.
Signed-off-by: Amir Goldstein amir73il@gmail.com Link: https://lore.kernel.org/r/20250105162404.357058-2-amir73il@gmail.com Signed-off-by: Christian Brauner brauner@kernel.org + Stable-dep-of: c45beebfde34 ("ovl: support encoding fid from inode with no alias") + Signed-off-by: Sasha Levin sashal@kernel.org + [re-applied over v6.6.71 with conflict resolved] + Signed-off-by: Amir Goldstein amir73il@gmail.com
## fs/overlayfs/copy_up.c ## @@ fs/overlayfs/copy_up.c: int ovl_set_attr(struct ovl_fs *ofs, struct dentry *upperdentry, @@ fs/overlayfs/copy_up.c: struct ovl_fh *ovl_encode_real_fh(struct ovl_fs *ofs, st buflen = (dwords << 2);
err = -EIO; -@@ fs/overlayfs/copy_up.c: struct ovl_fh *ovl_get_origin_fh(struct ovl_fs *ofs, struct dentry *origin) - if (!ovl_can_decode_fh(origin->d_sb)) - return NULL; - -- return ovl_encode_real_fh(ofs, origin, false); -+ return ovl_encode_real_fh(ofs, d_inode(origin), false); - } - - int ovl_set_origin_fh(struct ovl_fs *ofs, const struct ovl_fh *fh, +@@ fs/overlayfs/copy_up.c: int ovl_set_origin(struct ovl_fs *ofs, struct dentry *lower, + * up and a pure upper inode. + */ + if (ovl_can_decode_fh(lower->d_sb)) { +- fh = ovl_encode_real_fh(ofs, lower, false); ++ fh = ovl_encode_real_fh(ofs, d_inode(lower), false); + if (IS_ERR(fh)) + return PTR_ERR(fh); + } @@ fs/overlayfs/copy_up.c: static int ovl_set_upper_fh(struct ovl_fs *ofs, struct dentry *upper, const struct ovl_fh *fh; int err; @@ fs/overlayfs/export.c: static int ovl_dentry_to_fid(struct ovl_fs *ofs, struct d
## fs/overlayfs/namei.c ## -@@ fs/overlayfs/namei.c: int ovl_verify_origin_xattr(struct ovl_fs *ofs, struct dentry *dentry, +@@ fs/overlayfs/namei.c: int ovl_verify_set_fh(struct ovl_fs *ofs, struct dentry *dentry, struct ovl_fh *fh; int err;
@@ fs/overlayfs/overlayfs.h: int ovl_copy_up_with_data(struct dentry *dentry); -struct ovl_fh *ovl_encode_real_fh(struct ovl_fs *ofs, struct dentry *real, +struct ovl_fh *ovl_encode_real_fh(struct ovl_fs *ofs, struct inode *realinode, bool is_upper); - struct ovl_fh *ovl_get_origin_fh(struct ovl_fs *ofs, struct dentry *origin); - int ovl_set_origin_fh(struct ovl_fs *ofs, const struct ovl_fh *fh, + int ovl_set_origin(struct ovl_fs *ofs, struct dentry *lower, + struct dentry *upper); ---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.6.y | Success | Success | | stable/linux-6.1.y | Success | Failed |
Build Errors: Build error for stable/linux-6.1.y: fs/overlayfs/copy_up.c: In function 'ovl_encode_real_fh': fs/overlayfs/copy_up.c:360:19: error: too many arguments to function 'exportfs_encode_inode_fh' 360 | fh_type = exportfs_encode_inode_fh(realinode, (void *)fh->fb.fid, | ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from fs/overlayfs/copy_up.c:21: ./include/linux/exportfs.h:228:12: note: declared here 228 | extern int exportfs_encode_inode_fh(struct inode *inode, struct fid *fid, | ^~~~~~~~~~~~~~~~~~~~~~~~ make[3]: *** [scripts/Makefile.build:250: fs/overlayfs/copy_up.o] Error 1 make[3]: Target 'fs/overlayfs/' not remade because of errors. make[2]: *** [scripts/Makefile.build:503: fs/overlayfs] Error 2 make[2]: Target 'fs/' not remade because of errors. make[1]: *** [scripts/Makefile.build:503: fs] Error 2 make[1]: Target './' not remade because of errors. make: *** [Makefile:2009: .] Error 2 make: Target '__all' not remade because of errors.