xref: /OK3568_Linux_fs/kernel/fs/overlayfs/Kconfig (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0-only
2*4882a593Smuzhiyunconfig OVERLAY_FS
3*4882a593Smuzhiyun	tristate "Overlay filesystem support"
4*4882a593Smuzhiyun	select EXPORTFS
5*4882a593Smuzhiyun	help
6*4882a593Smuzhiyun	  An overlay filesystem combines two filesystems - an 'upper' filesystem
7*4882a593Smuzhiyun	  and a 'lower' filesystem.  When a name exists in both filesystems, the
8*4882a593Smuzhiyun	  object in the 'upper' filesystem is visible while the object in the
9*4882a593Smuzhiyun	  'lower' filesystem is either hidden or, in the case of directories,
10*4882a593Smuzhiyun	  merged with the 'upper' object.
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun	  For more information see Documentation/filesystems/overlayfs.rst
13*4882a593Smuzhiyun
14*4882a593Smuzhiyunconfig OVERLAY_FS_REDIRECT_DIR
15*4882a593Smuzhiyun	bool "Overlayfs: turn on redirect directory feature by default"
16*4882a593Smuzhiyun	depends on OVERLAY_FS
17*4882a593Smuzhiyun	help
18*4882a593Smuzhiyun	  If this config option is enabled then overlay filesystems will use
19*4882a593Smuzhiyun	  redirects when renaming directories by default.  In this case it is
20*4882a593Smuzhiyun	  still possible to turn off redirects globally with the
21*4882a593Smuzhiyun	  "redirect_dir=off" module option or on a filesystem instance basis
22*4882a593Smuzhiyun	  with the "redirect_dir=off" mount option.
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun	  Note, that redirects are not backward compatible.  That is, mounting
25*4882a593Smuzhiyun	  an overlay which has redirects on a kernel that doesn't support this
26*4882a593Smuzhiyun	  feature will have unexpected results.
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun	  If unsure, say N.
29*4882a593Smuzhiyun
30*4882a593Smuzhiyunconfig OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW
31*4882a593Smuzhiyun	bool "Overlayfs: follow redirects even if redirects are turned off"
32*4882a593Smuzhiyun	default y
33*4882a593Smuzhiyun	depends on OVERLAY_FS
34*4882a593Smuzhiyun	help
35*4882a593Smuzhiyun	  Disable this to get a possibly more secure configuration, but that
36*4882a593Smuzhiyun	  might not be backward compatible with previous kernels.
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun	  If backward compatibility is not an issue, then it is safe and
39*4882a593Smuzhiyun	  recommended to say N here.
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun	  For more information, see Documentation/filesystems/overlayfs.rst
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun	  If unsure, say Y.
44*4882a593Smuzhiyun
45*4882a593Smuzhiyunconfig OVERLAY_FS_INDEX
46*4882a593Smuzhiyun	bool "Overlayfs: turn on inodes index feature by default"
47*4882a593Smuzhiyun	depends on OVERLAY_FS
48*4882a593Smuzhiyun	help
49*4882a593Smuzhiyun	  If this config option is enabled then overlay filesystems will use
50*4882a593Smuzhiyun	  the index directory to map lower inodes to upper inodes by default.
51*4882a593Smuzhiyun	  In this case it is still possible to turn off index globally with the
52*4882a593Smuzhiyun	  "index=off" module option or on a filesystem instance basis with the
53*4882a593Smuzhiyun	  "index=off" mount option.
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun	  The inodes index feature prevents breaking of lower hardlinks on copy
56*4882a593Smuzhiyun	  up.
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun	  Note, that the inodes index feature is not backward compatible.
59*4882a593Smuzhiyun	  That is, mounting an overlay which has an inodes index on a kernel
60*4882a593Smuzhiyun	  that doesn't support this feature will have unexpected results.
61*4882a593Smuzhiyun
62*4882a593Smuzhiyun	  If unsure, say N.
63*4882a593Smuzhiyun
64*4882a593Smuzhiyunconfig OVERLAY_FS_NFS_EXPORT
65*4882a593Smuzhiyun	bool "Overlayfs: turn on NFS export feature by default"
66*4882a593Smuzhiyun	depends on OVERLAY_FS
67*4882a593Smuzhiyun	depends on OVERLAY_FS_INDEX
68*4882a593Smuzhiyun	depends on !OVERLAY_FS_METACOPY
69*4882a593Smuzhiyun	help
70*4882a593Smuzhiyun	  If this config option is enabled then overlay filesystems will use
71*4882a593Smuzhiyun	  the index directory to decode overlay NFS file handles by default.
72*4882a593Smuzhiyun	  In this case, it is still possible to turn off NFS export support
73*4882a593Smuzhiyun	  globally with the "nfs_export=off" module option or on a filesystem
74*4882a593Smuzhiyun	  instance basis with the "nfs_export=off" mount option.
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun	  The NFS export feature creates an index on copy up of every file and
77*4882a593Smuzhiyun	  directory.  This full index is used to detect overlay filesystems
78*4882a593Smuzhiyun	  inconsistencies on lookup, like redirect from multiple upper dirs to
79*4882a593Smuzhiyun	  the same lower dir.  The full index may incur some overhead on mount
80*4882a593Smuzhiyun	  time, especially when verifying that directory file handles are not
81*4882a593Smuzhiyun	  stale.
82*4882a593Smuzhiyun
83*4882a593Smuzhiyun	  Note, that the NFS export feature is not backward compatible.
84*4882a593Smuzhiyun	  That is, mounting an overlay which has a full index on a kernel
85*4882a593Smuzhiyun	  that doesn't support this feature will have unexpected results.
86*4882a593Smuzhiyun
87*4882a593Smuzhiyun	  Most users should say N here and enable this feature on a case-by-
88*4882a593Smuzhiyun	  case basis with the "nfs_export=on" mount option.
89*4882a593Smuzhiyun
90*4882a593Smuzhiyun	  Say N unless you fully understand the consequences.
91*4882a593Smuzhiyun
92*4882a593Smuzhiyunconfig OVERLAY_FS_XINO_AUTO
93*4882a593Smuzhiyun	bool "Overlayfs: auto enable inode number mapping"
94*4882a593Smuzhiyun	default n
95*4882a593Smuzhiyun	depends on OVERLAY_FS
96*4882a593Smuzhiyun	depends on 64BIT
97*4882a593Smuzhiyun	help
98*4882a593Smuzhiyun	  If this config option is enabled then overlay filesystems will use
99*4882a593Smuzhiyun	  unused high bits in undelying filesystem inode numbers to map all
100*4882a593Smuzhiyun	  inodes to a unified address space.  The mapped 64bit inode numbers
101*4882a593Smuzhiyun	  might not be compatible with applications that expect 32bit inodes.
102*4882a593Smuzhiyun
103*4882a593Smuzhiyun	  If compatibility with applications that expect 32bit inodes is not an
104*4882a593Smuzhiyun	  issue, then it is safe and recommended to say Y here.
105*4882a593Smuzhiyun
106*4882a593Smuzhiyun	  For more information, see Documentation/filesystems/overlayfs.rst
107*4882a593Smuzhiyun
108*4882a593Smuzhiyun	  If unsure, say N.
109*4882a593Smuzhiyun
110*4882a593Smuzhiyunconfig OVERLAY_FS_METACOPY
111*4882a593Smuzhiyun	bool "Overlayfs: turn on metadata only copy up feature by default"
112*4882a593Smuzhiyun	depends on OVERLAY_FS
113*4882a593Smuzhiyun	select OVERLAY_FS_REDIRECT_DIR
114*4882a593Smuzhiyun	help
115*4882a593Smuzhiyun	  If this config option is enabled then overlay filesystems will
116*4882a593Smuzhiyun	  copy up only metadata where appropriate and data copy up will
117*4882a593Smuzhiyun	  happen when a file is opened for WRITE operation. It is still
118*4882a593Smuzhiyun	  possible to turn off this feature globally with the "metacopy=off"
119*4882a593Smuzhiyun	  module option or on a filesystem instance basis with the
120*4882a593Smuzhiyun	  "metacopy=off" mount option.
121*4882a593Smuzhiyun
122*4882a593Smuzhiyun	  Note, that this feature is not backward compatible.  That is,
123*4882a593Smuzhiyun	  mounting an overlay which has metacopy only inodes on a kernel
124*4882a593Smuzhiyun	  that doesn't support this feature will have unexpected results.
125*4882a593Smuzhiyun
126*4882a593Smuzhiyun	  If unsure, say N.
127