xref: /openbmc/linux/fs/overlayfs/Kconfig (revision 53afcd31)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
2ef94b186SMiklos Szerediconfig OVERLAY_FS
3e9be9d5eSMiklos Szeredi	tristate "Overlay filesystem support"
472d42504SArnd Bergmann	select EXPORTFS
5e9be9d5eSMiklos Szeredi	help
6e9be9d5eSMiklos Szeredi	  An overlay filesystem combines two filesystems - an 'upper' filesystem
7e9be9d5eSMiklos Szeredi	  and a 'lower' filesystem.  When a name exists in both filesystems, the
8e9be9d5eSMiklos Szeredi	  object in the 'upper' filesystem is visible while the object in the
9e9be9d5eSMiklos Szeredi	  'lower' filesystem is either hidden or, in the case of directories,
10e9be9d5eSMiklos Szeredi	  merged with the 'upper' object.
11e9be9d5eSMiklos Szeredi
12e9be9d5eSMiklos Szeredi	  For more information see Documentation/filesystems/overlayfs.txt
13688ea0e5SMiklos Szeredi
14688ea0e5SMiklos Szerediconfig OVERLAY_FS_REDIRECT_DIR
154280f74aSMiklos Szeredi	bool "Overlayfs: turn on redirect directory feature by default"
16688ea0e5SMiklos Szeredi	depends on OVERLAY_FS
17688ea0e5SMiklos Szeredi	help
18688ea0e5SMiklos Szeredi	  If this config option is enabled then overlay filesystems will use
19688ea0e5SMiklos Szeredi	  redirects when renaming directories by default.  In this case it is
20688ea0e5SMiklos Szeredi	  still possible to turn off redirects globally with the
21688ea0e5SMiklos Szeredi	  "redirect_dir=off" module option or on a filesystem instance basis
22688ea0e5SMiklos Szeredi	  with the "redirect_dir=off" mount option.
23688ea0e5SMiklos Szeredi
24688ea0e5SMiklos Szeredi	  Note, that redirects are not backward compatible.  That is, mounting
25688ea0e5SMiklos Szeredi	  an overlay which has redirects on a kernel that doesn't support this
26688ea0e5SMiklos Szeredi	  feature will have unexpected results.
2702bcd157SAmir Goldstein
2836cd95dfSMiklos Szeredi	  If unsure, say N.
2936cd95dfSMiklos Szeredi
30438c84c2SMiklos Szerediconfig OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW
31438c84c2SMiklos Szeredi	bool "Overlayfs: follow redirects even if redirects are turned off"
32438c84c2SMiklos Szeredi	default y
33438c84c2SMiklos Szeredi	depends on OVERLAY_FS
34438c84c2SMiklos Szeredi	help
35438c84c2SMiklos Szeredi	  Disable this to get a possibly more secure configuration, but that
36438c84c2SMiklos Szeredi	  might not be backward compatible with previous kernels.
37438c84c2SMiklos Szeredi
3836cd95dfSMiklos Szeredi	  If backward compatibility is not an issue, then it is safe and
3936cd95dfSMiklos Szeredi	  recommended to say N here.
4036cd95dfSMiklos Szeredi
41438c84c2SMiklos Szeredi	  For more information, see Documentation/filesystems/overlayfs.txt
42438c84c2SMiklos Szeredi
4336cd95dfSMiklos Szeredi	  If unsure, say Y.
4436cd95dfSMiklos Szeredi
4502bcd157SAmir Goldsteinconfig OVERLAY_FS_INDEX
4602bcd157SAmir Goldstein	bool "Overlayfs: turn on inodes index feature by default"
4702bcd157SAmir Goldstein	depends on OVERLAY_FS
4802bcd157SAmir Goldstein	help
4902bcd157SAmir Goldstein	  If this config option is enabled then overlay filesystems will use
504280f74aSMiklos Szeredi	  the index directory to map lower inodes to upper inodes by default.
5102bcd157SAmir Goldstein	  In this case it is still possible to turn off index globally with the
5202bcd157SAmir Goldstein	  "index=off" module option or on a filesystem instance basis with the
5302bcd157SAmir Goldstein	  "index=off" mount option.
5402bcd157SAmir Goldstein
5502bcd157SAmir Goldstein	  The inodes index feature prevents breaking of lower hardlinks on copy
5602bcd157SAmir Goldstein	  up.
5702bcd157SAmir Goldstein
5860b86642SAmir Goldstein	  Note, that the inodes index feature is not backward compatible.
5960b86642SAmir Goldstein	  That is, mounting an overlay which has an inodes index on a kernel
6060b86642SAmir Goldstein	  that doesn't support this feature will have unexpected results.
61f168f109SAmir Goldstein
6236cd95dfSMiklos Szeredi	  If unsure, say N.
6336cd95dfSMiklos Szeredi
64f168f109SAmir Goldsteinconfig OVERLAY_FS_NFS_EXPORT
65f168f109SAmir Goldstein	bool "Overlayfs: turn on NFS export feature by default"
66f168f109SAmir Goldstein	depends on OVERLAY_FS
67f168f109SAmir Goldstein	depends on OVERLAY_FS_INDEX
68d5791044SVivek Goyal	depends on !OVERLAY_FS_METACOPY
69f168f109SAmir Goldstein	help
70f168f109SAmir Goldstein	  If this config option is enabled then overlay filesystems will use
714280f74aSMiklos Szeredi	  the index directory to decode overlay NFS file handles by default.
72f168f109SAmir Goldstein	  In this case, it is still possible to turn off NFS export support
73f168f109SAmir Goldstein	  globally with the "nfs_export=off" module option or on a filesystem
74f168f109SAmir Goldstein	  instance basis with the "nfs_export=off" mount option.
75f168f109SAmir Goldstein
76f168f109SAmir Goldstein	  The NFS export feature creates an index on copy up of every file and
77f168f109SAmir Goldstein	  directory.  This full index is used to detect overlay filesystems
78f168f109SAmir Goldstein	  inconsistencies on lookup, like redirect from multiple upper dirs to
79f168f109SAmir Goldstein	  the same lower dir.  The full index may incur some overhead on mount
80f168f109SAmir Goldstein	  time, especially when verifying that directory file handles are not
81f168f109SAmir Goldstein	  stale.
82f168f109SAmir Goldstein
83f168f109SAmir Goldstein	  Note, that the NFS export feature is not backward compatible.
84f168f109SAmir Goldstein	  That is, mounting an overlay which has a full index on a kernel
85f168f109SAmir Goldstein	  that doesn't support this feature will have unexpected results.
8636cd95dfSMiklos Szeredi
8736cd95dfSMiklos Szeredi	  Most users should say N here and enable this feature on a case-by-
8836cd95dfSMiklos Szeredi	  case basis with the "nfs_export=on" mount option.
8936cd95dfSMiklos Szeredi
9036cd95dfSMiklos Szeredi	  Say N unless you fully understand the consequences.
91795939a9SAmir Goldstein
92795939a9SAmir Goldsteinconfig OVERLAY_FS_XINO_AUTO
93795939a9SAmir Goldstein	bool "Overlayfs: auto enable inode number mapping"
94795939a9SAmir Goldstein	default n
95795939a9SAmir Goldstein	depends on OVERLAY_FS
9653afcd31SAmir Goldstein	depends on 64BIT
97795939a9SAmir Goldstein	help
98795939a9SAmir Goldstein	  If this config option is enabled then overlay filesystems will use
99795939a9SAmir Goldstein	  unused high bits in undelying filesystem inode numbers to map all
100795939a9SAmir Goldstein	  inodes to a unified address space.  The mapped 64bit inode numbers
101795939a9SAmir Goldstein	  might not be compatible with applications that expect 32bit inodes.
102795939a9SAmir Goldstein
103795939a9SAmir Goldstein	  If compatibility with applications that expect 32bit inodes is not an
104795939a9SAmir Goldstein	  issue, then it is safe and recommended to say Y here.
105795939a9SAmir Goldstein
106795939a9SAmir Goldstein	  For more information, see Documentation/filesystems/overlayfs.txt
107795939a9SAmir Goldstein
108795939a9SAmir Goldstein	  If unsure, say N.
109d5791044SVivek Goyal
110d5791044SVivek Goyalconfig OVERLAY_FS_METACOPY
111d5791044SVivek Goyal	bool "Overlayfs: turn on metadata only copy up feature by default"
112d5791044SVivek Goyal	depends on OVERLAY_FS
113d5791044SVivek Goyal	select OVERLAY_FS_REDIRECT_DIR
114d5791044SVivek Goyal	help
115d5791044SVivek Goyal	  If this config option is enabled then overlay filesystems will
116d5791044SVivek Goyal	  copy up only metadata where appropriate and data copy up will
117d5791044SVivek Goyal	  happen when a file is opened for WRITE operation. It is still
118d5791044SVivek Goyal	  possible to turn off this feature globally with the "metacopy=off"
119d5791044SVivek Goyal	  module option or on a filesystem instance basis with the
120d5791044SVivek Goyal	  "metacopy=off" mount option.
121d5791044SVivek Goyal
122d5791044SVivek Goyal	  Note, that this feature is not backward compatible.  That is,
123d5791044SVivek Goyal	  mounting an overlay which has metacopy only inodes on a kernel
124d5791044SVivek Goyal	  that doesn't support this feature will have unexpected results.
125d5791044SVivek Goyal
126d5791044SVivek Goyal	  If unsure, say N.
127