Skip to content

Commit 53afcd3

Browse files
amir73ilMiklos Szeredi
authored andcommitted
ovl: fix some xino configurations
Fix up two bugs in the coversion to xino_mode: 1. xino=off does not always end up in disabled mode 2. xino=auto on 32bit arch should end up in disabled mode Take a proactive approach to disabling xino on 32bit kernel: 1. Disable XINO_AUTO config during build time 2. Disable xino with a warning on mount time As a by product, xino=on on 32bit arch also ends up in disabled mode. We never intended to enable xino on 32bit arch and this will make the rest of the logic simpler. Fixes: 0f831ec ("ovl: simplify ovl_same_sb() helper") Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
1 parent 531d304 commit 53afcd3

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

fs/overlayfs/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ config OVERLAY_FS_XINO_AUTO
9393
bool "Overlayfs: auto enable inode number mapping"
9494
default n
9595
depends on OVERLAY_FS
96+
depends on 64BIT
9697
help
9798
If this config option is enabled then overlay filesystems will use
9899
unused high bits in undelying filesystem inode numbers to map all

fs/overlayfs/super.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1411,6 +1411,8 @@ static int ovl_get_layers(struct super_block *sb, struct ovl_fs *ofs,
14111411
if (ofs->config.xino == OVL_XINO_ON)
14121412
pr_info("\"xino=on\" is useless with all layers on same fs, ignore.\n");
14131413
ofs->xino_mode = 0;
1414+
} else if (ofs->config.xino == OVL_XINO_OFF) {
1415+
ofs->xino_mode = -1;
14141416
} else if (ofs->config.xino == OVL_XINO_ON && ofs->xino_mode < 0) {
14151417
/*
14161418
* This is a roundup of number of bits needed for encoding
@@ -1623,8 +1625,13 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
16231625
sb->s_stack_depth = 0;
16241626
sb->s_maxbytes = MAX_LFS_FILESIZE;
16251627
/* Assume underlaying fs uses 32bit inodes unless proven otherwise */
1626-
if (ofs->config.xino != OVL_XINO_OFF)
1628+
if (ofs->config.xino != OVL_XINO_OFF) {
16271629
ofs->xino_mode = BITS_PER_LONG - 32;
1630+
if (!ofs->xino_mode) {
1631+
pr_warn("xino not supported on 32bit kernel, falling back to xino=off.\n");
1632+
ofs->config.xino = OVL_XINO_OFF;
1633+
}
1634+
}
16281635

16291636
/* alloc/destroy_inode needed for setting up traps in inode cache */
16301637
sb->s_op = &ovl_super_operations;

0 commit comments

Comments
 (0)