Skip to content

Commit 3699caf

Browse files
amir73ilgregkh
authored andcommitted
ovl: fix wrong detection of 32bit inode numbers
commit 53a7c171e9dd833f0a96b545adcb89bd57387239 upstream. The implicit FILEID_INO32_GEN encoder was changed to be explicit, so we need to fix the detection. When mounting overlayfs with upperdir and lowerdir on different ext4 filesystems, the expected kmsg log is: overlayfs: "xino" feature enabled using 32 upper inode bits. But instead, since the regressing commit, the kmsg log was: overlayfs: "xino" feature enabled using 2 upper inode bits. Fixes: e21fc20 ("exportfs: make ->encode_fh() a mandatory method for NFS export") Cc: stable@vger.kernel.org # v6.7+ Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a9f911b commit 3699caf

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

fs/overlayfs/util.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ int ovl_can_decode_fh(struct super_block *sb)
8484
if (!exportfs_can_decode_fh(sb->s_export_op))
8585
return 0;
8686

87-
return sb->s_export_op->encode_fh ? -1 : FILEID_INO32_GEN;
87+
if (sb->s_export_op->encode_fh == generic_encode_ino32_fh)
88+
return FILEID_INO32_GEN;
89+
90+
return -1;
8891
}
8992

9093
struct dentry *ovl_indexdir(struct super_block *sb)

0 commit comments

Comments
 (0)