2005-04-16 15:20:36 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-27 10:47:13 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 17:04:11 +09:00
|
|
|
|
2008-02-08 04:21:43 -08:00
|
|
|
|
2022-02-09 20:22:03 +00:00
|
|
|
|
2008-02-09 00:10:14 -08:00
|
|
|
|
2024-05-30 20:01:11 +08:00
|
|
|
|
2024-07-25 14:51:30 +08:00
|
|
|
|
2010-06-06 21:51:16 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2012-10-08 03:27:32 +01:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2024-05-30 20:01:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-09-02 15:28:45 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-02-27 22:55:20 +01:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
2025-02-14 10:28:22 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2013-01-23 17:07:38 -05:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2021-01-13 21:31:55 +01:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-03-07 20:41:08 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2007-02-12 00:55:39 -08:00
|
|
|
|
|
|
|
|
|
2010-06-06 21:51:16 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-11 12:04:38 +08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
|
|
|
|
|
2011-01-07 17:49:29 +11:00
|
|
|
|
2025-01-11 01:37:44 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
2025-01-11 01:37:44 -05:00
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-03 23:41:52 +01:00
|
|
|
|
2025-01-11 01:37:44 -05:00
|
|
|
|
|
|
|
|
|
2015-03-03 23:42:25 +01:00
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-06 20:42:10 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
|
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-03-27 10:47:12 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2010-06-06 20:42:10 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2011-01-07 17:49:29 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-01-07 17:49:29 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-20 15:07:35 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2021-03-25 14:12:34 -04:00
|
|
|
|
2015-03-03 23:55:49 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-03-03 23:55:49 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-03-03 23:55:49 +01:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-03-03 23:55:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-20 15:07:35 +02:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-25 14:12:34 -04:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2021-03-25 14:12:34 -04:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2013-11-14 21:15:13 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-30 20:01:11 +08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2024-05-30 20:01:11 +08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2010-10-26 14:21:18 -07:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-22 14:41:03 -07:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2010-06-06 17:53:01 -04:00
|
|
|
|
2013-03-27 10:47:14 +00:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-02-27 22:55:20 +01:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2010-06-06 15:16:17 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-04-03 14:47:49 -07:00
|
|
|
|
2012-05-03 14:48:02 +02:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-04-15 20:12:11 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2021-01-13 21:31:55 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-01-07 17:49:49 +11:00
|
|
|
|
2011-12-08 21:32:45 -05:00
|
|
|
|
2008-02-08 04:21:43 -08:00
|
|
|
|
2024-05-30 20:01:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-08 04:21:43 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fs: create and use seq_show_option for escaping
Many file systems that implement the show_options hook fail to correctly
escape their output which could lead to unescaped characters (e.g. new
lines) leaking into /proc/mounts and /proc/[pid]/mountinfo files. This
could lead to confusion, spoofed entries (resulting in things like
systemd issuing false d-bus "mount" notifications), and who knows what
else. This looks like it would only be the root user stepping on
themselves, but it's possible weird things could happen in containers or
in other situations with delegated mount privileges.
Here's an example using overlay with setuid fusermount trusting the
contents of /proc/mounts (via the /etc/mtab symlink). Imagine the use
of "sudo" is something more sneaky:
$ BASE="ovl"
$ MNT="$BASE/mnt"
$ LOW="$BASE/lower"
$ UP="$BASE/upper"
$ WORK="$BASE/work/ 0 0
none /proc fuse.pwn user_id=1000"
$ mkdir -p "$LOW" "$UP" "$WORK"
$ sudo mount -t overlay -o "lowerdir=$LOW,upperdir=$UP,workdir=$WORK" none /mnt
$ cat /proc/mounts
none /root/ovl/mnt overlay rw,relatime,lowerdir=ovl/lower,upperdir=ovl/upper,workdir=ovl/work/ 0 0
none /proc fuse.pwn user_id=1000 0 0
$ fusermount -u /proc
$ cat /proc/mounts
cat: /proc/mounts: No such file or directory
This fixes the problem by adding new seq_show_option and
seq_show_option_n helpers, and updating the vulnerable show_option
handlers to use them as needed. Some, like SELinux, need to be open
coded due to unusual existing escape mechanisms.
[akpm@linux-foundation.org: add lost chunk, per Kees]
[keescook@chromium.org: seq_show_option should be using const parameters]
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Acked-by: Jan Kara <jack@suse.com>
Acked-by: Paul Moore <paul@paul-moore.com>
Cc: J. R. Okajima <hooanon05g@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-04 15:44:57 -07:00
|
|
|
|
2008-02-08 04:21:43 -08:00
|
|
|
|
2015-03-04 00:00:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-08 04:21:43 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-02-12 00:55:41 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2019-04-15 20:12:11 -04:00
|
|
|
|
2025-09-15 14:57:29 +02:00
|
|
|
|
2010-06-06 15:16:17 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-02-08 04:21:43 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2013-11-14 21:15:13 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-27 19:14:58 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-06-06 20:42:10 -04:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2013-05-22 16:34:19 -04:00
|
|
|
|
2015-03-24 15:47:38 +01:00
|
|
|
|
2012-01-27 19:14:58 +01:00
|
|
|
|
2013-05-22 16:34:19 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2015-03-02 00:09:33 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2015-03-04 00:06:38 +01:00
|
|
|
|
2010-06-06 23:49:18 -04:00
|
|
|
|
2015-03-04 00:06:38 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-06-06 23:49:18 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-06-06 23:49:18 -04:00
|
|
|
|
2015-03-04 22:39:48 +01:00
|
|
|
|
|
|
|
|
|
2010-06-06 23:49:18 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-06-06 23:49:18 -04:00
|
|
|
|
2015-03-04 00:05:11 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2021-04-15 22:03:00 -04:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2010-06-06 23:49:18 -04:00
|
|
|
|
2015-02-27 22:55:20 +01:00
|
|
|
|
2010-06-06 23:49:18 -04:00
|
|
|
|
|
|
|
|
|
2015-02-27 22:55:20 +01:00
|
|
|
|
2015-02-27 22:56:28 +01:00
|
|
|
|
2010-06-06 23:49:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-27 22:55:20 +01:00
|
|
|
|
2010-06-06 23:49:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-27 22:55:20 +01:00
|
|
|
|
2010-06-06 23:49:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-27 22:55:20 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2013-08-04 17:23:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-11-14 21:15:13 +00:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-07-16 20:44:56 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-07 15:20:52 -04:00
|
|
|
|
2011-07-16 20:44:56 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-01-22 15:40:57 -05:00
|
|
|
|
2011-07-16 20:44:56 -04:00
|
|
|
|
2016-01-22 15:40:57 -05:00
|
|
|
|
2011-07-16 20:44:56 -04:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2006-03-28 01:56:42 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2023-05-22 14:50:15 +01:00
|
|
|
|
2021-07-06 23:12:42 +02:00
|
|
|
|
2014-04-02 14:33:16 -04:00
|
|
|
|
2014-04-03 03:17:43 -04:00
|
|
|
|
fs: convert simple use of generic_file_*_mmap() to .mmap_prepare()
Since commit c84bf6dd2b83 ("mm: introduce new .mmap_prepare() file
callback"), the f_op->mmap() hook has been deprecated in favour of
f_op->mmap_prepare().
We have provided generic .mmap_prepare() equivalents, so update all file
systems that specify these directly in their file_operations structures.
This updates 9p, adfs, affs, bfs, fat, hfs, hfsplus, hostfs, hpfs, jffs2,
jfs, minix, omfs, ramfs and ufs file systems directly.
It updates generic_ro_fops which impacts qnx4, cramfs, befs, squashfs,
frebxfs, qnx6, efs, romfs, erofs and isofs file systems.
There are remaining file systems which use generic hooks in a less direct
way which we address in a subsequent commit.
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Link: https://lore.kernel.org/c7dc90e44a9e75e750939ea369290d6e441a18e6.1750099179.git.lorenzo.stoakes@oracle.com
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-06-16 20:33:27 +01:00
|
|
|
|
2015-03-02 00:09:33 +01:00
|
|
|
|
2013-08-04 17:23:51 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-03-28 01:56:42 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2016-05-12 19:49:30 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-03-02 00:09:33 +01:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2024-12-20 05:14:58 +00:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2024-12-20 05:14:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2024-12-20 05:14:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2024-12-20 05:14:58 +00:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2024-12-20 05:14:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-29 11:12:16 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2024-05-30 21:20:59 +01:00
|
|
|
|
2015-03-04 12:44:03 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2024-05-30 21:20:59 +01:00
|
|
|
|
2015-03-03 21:40:55 +01:00
|
|
|
|
mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros
PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
ago with promise that one day it will be possible to implement page
cache with bigger chunks than PAGE_SIZE.
This promise never materialized. And unlikely will.
We have many places where PAGE_CACHE_SIZE assumed to be equal to
PAGE_SIZE. And it's constant source of confusion on whether
PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
especially on the border between fs and mm.
Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
breakage to be doable.
Let's stop pretending that pages in page cache are special. They are
not.
The changes are pretty straight-forward:
- <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
- <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
- PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};
- page_cache_get() -> get_page();
- page_cache_release() -> put_page();
This patch contains automated changes generated with coccinelle using
script below. For some reason, coccinelle doesn't patch header files.
I've called spatch for them manually.
The only adjustment after coccinelle is revert of changes to
PAGE_CAHCE_ALIGN definition: we are going to drop it later.
There are few places in the code where coccinelle didn't reach. I'll
fix them manually in a separate patch. Comments and documentation also
will be addressed with the separate patch.
virtual patch
@@
expression E;
@@
- E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
+ E
@@
expression E;
@@
- E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
+ E
@@
@@
- PAGE_CACHE_SHIFT
+ PAGE_SHIFT
@@
@@
- PAGE_CACHE_SIZE
+ PAGE_SIZE
@@
@@
- PAGE_CACHE_MASK
+ PAGE_MASK
@@
expression E;
@@
- PAGE_CACHE_ALIGN(E)
+ PAGE_ALIGN(E)
@@
expression E;
@@
- page_cache_get(E)
+ get_page(E)
@@
expression E;
@@
- page_cache_release(E)
+ put_page(E)
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-04-01 15:29:47 +03:00
|
|
|
|
2024-05-30 21:20:59 +01:00
|
|
|
|
2015-03-03 21:40:55 +01:00
|
|
|
|
2024-05-30 21:20:59 +01:00
|
|
|
|
2024-07-23 18:14:54 -07:00
|
|
|
|
2022-10-13 18:17:00 +02:00
|
|
|
|
|
|
|
|
|
2024-05-30 21:20:59 +01:00
|
|
|
|
2015-03-03 21:40:55 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2025-07-16 09:36:06 +00:00
|
|
|
|
|
|
|
|
|
2022-02-22 14:31:43 -05:00
|
|
|
|
2024-07-15 14:24:01 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros
PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
ago with promise that one day it will be possible to implement page
cache with bigger chunks than PAGE_SIZE.
This promise never materialized. And unlikely will.
We have many places where PAGE_CACHE_SIZE assumed to be equal to
PAGE_SIZE. And it's constant source of confusion on whether
PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
especially on the border between fs and mm.
Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
breakage to be doable.
Let's stop pretending that pages in page cache are special. They are
not.
The changes are pretty straight-forward:
- <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
- <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
- PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};
- page_cache_get() -> get_page();
- page_cache_release() -> put_page();
This patch contains automated changes generated with coccinelle using
script below. For some reason, coccinelle doesn't patch header files.
I've called spatch for them manually.
The only adjustment after coccinelle is revert of changes to
PAGE_CAHCE_ALIGN definition: we are going to drop it later.
There are few places in the code where coccinelle didn't reach. I'll
fix them manually in a separate patch. Comments and documentation also
will be addressed with the separate patch.
virtual patch
@@
expression E;
@@
- E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
+ E
@@
expression E;
@@
- E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
+ E
@@
@@
- PAGE_CACHE_SHIFT
+ PAGE_SHIFT
@@
@@
- PAGE_CACHE_SIZE
+ PAGE_SIZE
@@
@@
- PAGE_CACHE_MASK
+ PAGE_MASK
@@
expression E;
@@
- PAGE_CACHE_ALIGN(E)
+ PAGE_ALIGN(E)
@@
expression E;
@@
- page_cache_get(E)
+ get_page(E)
@@
expression E;
@@
- page_cache_release(E)
+ put_page(E)
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-04-01 15:29:47 +03:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2024-07-15 14:24:01 -04:00
|
|
|
|
|
|
|
|
|
2024-11-04 20:34:40 +08:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:25:17 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2025-07-16 09:36:06 +00:00
|
|
|
|
|
|
|
|
|
2013-11-14 21:15:13 +00:00
|
|
|
|
2024-07-10 15:45:32 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:25:17 -07:00
|
|
|
|
2024-07-12 12:08:54 -04:00
|
|
|
|
2007-10-16 01:25:17 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2024-07-12 12:08:54 -04:00
|
|
|
|
2025-07-16 09:36:06 +00:00
|
|
|
|
2022-10-13 18:17:00 +02:00
|
|
|
|
2007-10-16 01:25:17 -07:00
|
|
|
|
2024-07-12 12:08:54 -04:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:25:17 -07:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:25:17 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-12 12:08:54 -04:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:25:17 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2006-06-28 04:26:44 -07:00
|
|
|
|
2024-12-20 05:14:58 +00:00
|
|
|
|
2022-04-29 11:12:16 -04:00
|
|
|
|
2022-02-09 20:22:03 +00:00
|
|
|
|
2007-10-16 01:25:17 -07:00
|
|
|
|
|
|
|
|
|
2024-12-20 05:14:58 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-04 14:52:28 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-07-05 15:01:15 -04:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-02 09:24:41 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-06-06 19:38:18 -04:00
|
|
|
|
2024-07-02 09:24:41 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
2010-06-06 20:33:12 -04:00
|
|
|
|
2010-06-06 21:51:16 -04:00
|
|
|
|
2010-06-06 20:33:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
2010-06-06 20:33:12 -04:00
|
|
|
|
|
|
|
|
|
2015-03-02 00:10:25 +01:00
|
|
|
|
2010-06-06 20:33:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-02 00:10:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-06-06 20:33:12 -04:00
|
|
|
|
2024-07-02 09:24:41 +02:00
|
|
|
|
2025-02-14 10:28:22 +01:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-02 09:24:41 +02:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
2025-02-14 10:28:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Coccinelle-based conversion to use ->i_state accessors
All places were patched by coccinelle with the default expecting that
->i_lock is held, afterwards entries got fixed up by hand to use
unlocked variants as needed.
The script:
@@
expression inode, flags;
@@
- inode->i_state & flags
+ inode_state_read(inode) & flags
@@
expression inode, flags;
@@
- inode->i_state &= ~flags
+ inode_state_clear(inode, flags)
@@
expression inode, flag1, flag2;
@@
- inode->i_state &= ~flag1 & ~flag2
+ inode_state_clear(inode, flag1 | flag2)
@@
expression inode, flags;
@@
- inode->i_state |= flags
+ inode_state_set(inode, flags)
@@
expression inode, flags;
@@
- inode->i_state = flags
+ inode_state_assign(inode, flags)
@@
expression inode, flags;
@@
- flags = inode->i_state
+ flags = inode_state_read(inode)
@@
expression inode, flags;
@@
- READ_ONCE(inode->i_state) & flags
+ inode_state_read(inode) & flags
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-10-09 09:59:18 +02:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2023-01-13 12:49:13 +01:00
|
|
|
|
2021-01-21 14:19:43 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-06-06 20:42:10 -04:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-05-04 14:50:29 +02:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2013-11-14 21:15:13 +00:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2010-06-06 20:42:10 -04:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-11 01:11:47 -05:00
|
|
|
|
|
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
2018-06-23 20:27:29 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2013-11-14 21:15:13 +00:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-06-06 20:42:10 -04:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2010-06-06 20:42:10 -04:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
|
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2013-11-14 21:15:13 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-06-06 23:19:04 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2023-01-13 12:49:14 +01:00
|
|
|
|
2021-01-21 14:19:43 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-06 20:42:10 -04:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
Change inode_operations.mkdir to return struct dentry *
Some filesystems, such as NFS, cifs, ceph, and fuse, do not have
complete control of sequencing on the actual filesystem (e.g. on a
different server) and may find that the inode created for a mkdir
request already exists in the icache and dcache by the time the mkdir
request returns. For example, if the filesystem is mounted twice the
directory could be visible on the other mount before it is on the
original mount, and a pair of name_to_handle_at(), open_by_handle_at()
calls could instantiate the directory inode with an IS_ROOT() dentry
before the first mkdir returns.
This means that the dentry passed to ->mkdir() may not be the one that
is associated with the inode after the ->mkdir() completes. Some
callers need to interact with the inode after the ->mkdir completes and
they currently need to perform a lookup in the (rare) case that the
dentry is no longer hashed.
This lookup-after-mkdir requires that the directory remains locked to
avoid races. Planned future patches to lock the dentry rather than the
directory will mean that this lookup cannot be performed atomically with
the mkdir.
To remove this barrier, this patch changes ->mkdir to return the
resulting dentry if it is different from the one passed in.
Possible returns are:
NULL - the directory was created and no other dentry was used
ERR_PTR() - an error occurred
non-NULL - this other dentry was spliced in
This patch only changes file-systems to return "ERR_PTR(err)" instead of
"err" or equivalent transformations. Subsequent patches will make
further changes to some file-systems to return a correct dentry.
Not all filesystems reliably result in a positive hashed dentry:
- NFS, cifs, hostfs will sometimes need to perform a lookup of
the name to get inode information. Races could result in this
returning something different. Note that this lookup is
non-atomic which is what we are trying to avoid. Placing the
lookup in filesystem code means it only happens when the filesystem
has no other option.
- kernfs and tracefs leave the dentry negative and the ->revalidate
operation ensures that lookup will be called to correctly populate
the dentry. This could be fixed but I don't think it is important
to any of the users of vfs_mkdir() which look at the dentry.
The recommendation to use
d_drop();d_splice_alias()
is ugly but fits with current practice. A planned future patch will
change this.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: NeilBrown <neilb@suse.de>
Link: https://lore.kernel.org/r/20250227013949.536172-2-neilb@suse.de
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-02-27 12:32:53 +11:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2025-02-27 12:32:54 +11:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-06 20:42:10 -04:00
|
|
|
|
Change inode_operations.mkdir to return struct dentry *
Some filesystems, such as NFS, cifs, ceph, and fuse, do not have
complete control of sequencing on the actual filesystem (e.g. on a
different server) and may find that the inode created for a mkdir
request already exists in the icache and dcache by the time the mkdir
request returns. For example, if the filesystem is mounted twice the
directory could be visible on the other mount before it is on the
original mount, and a pair of name_to_handle_at(), open_by_handle_at()
calls could instantiate the directory inode with an IS_ROOT() dentry
before the first mkdir returns.
This means that the dentry passed to ->mkdir() may not be the one that
is associated with the inode after the ->mkdir() completes. Some
callers need to interact with the inode after the ->mkdir completes and
they currently need to perform a lookup in the (rare) case that the
dentry is no longer hashed.
This lookup-after-mkdir requires that the directory remains locked to
avoid races. Planned future patches to lock the dentry rather than the
directory will mean that this lookup cannot be performed atomically with
the mkdir.
To remove this barrier, this patch changes ->mkdir to return the
resulting dentry if it is different from the one passed in.
Possible returns are:
NULL - the directory was created and no other dentry was used
ERR_PTR() - an error occurred
non-NULL - this other dentry was spliced in
This patch only changes file-systems to return "ERR_PTR(err)" instead of
"err" or equivalent transformations. Subsequent patches will make
further changes to some file-systems to return a correct dentry.
Not all filesystems reliably result in a positive hashed dentry:
- NFS, cifs, hostfs will sometimes need to perform a lookup of
the name to get inode information. Races could result in this
returning something different. Note that this lookup is
non-atomic which is what we are trying to avoid. Placing the
lookup in filesystem code means it only happens when the filesystem
has no other option.
- kernfs and tracefs leave the dentry negative and the ->revalidate
operation ensures that lookup will be called to correctly populate
the dentry. This could be fixed but I don't think it is important
to any of the users of vfs_mkdir() which look at the dentry.
The recommendation to use
d_drop();d_splice_alias()
is ugly but fits with current practice. A planned future patch will
change this.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: NeilBrown <neilb@suse.de>
Link: https://lore.kernel.org/r/20250227013949.536172-2-neilb@suse.de
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-02-27 12:32:53 +11:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2025-02-27 12:32:54 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
2025-02-27 12:32:54 +11:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2013-11-14 21:15:13 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-06 20:42:10 -04:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2018-03-11 11:34:48 +01:00
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2023-01-13 12:49:16 +01:00
|
|
|
|
2021-01-21 14:19:43 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-07 00:15:50 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-06-06 20:42:10 -04:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-01-29 13:19:44 -08:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2023-01-13 12:49:17 +01:00
|
|
|
|
2021-01-21 14:19:43 +01:00
|
|
|
|
2014-07-23 15:15:35 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-07-23 15:15:35 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2014-07-23 15:15:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2014-07-23 15:15:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-07-23 15:15:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2023-01-13 12:49:22 +01:00
|
|
|
|
2021-01-21 14:19:43 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-20 19:28:19 -04:00
|
|
|
|
2011-01-07 17:49:58 +11:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-06 20:42:10 -04:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2023-01-13 12:49:22 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-13 12:49:11 +01:00
|
|
|
|
2021-01-21 14:19:43 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-04 11:30:02 +02:00
|
|
|
|
2007-05-08 00:23:16 -07:00
|
|
|
|
2023-01-13 12:49:11 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2012-02-07 16:28:57 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2012-02-07 16:28:57 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2018-06-12 15:31:17 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2018-06-12 15:31:17 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2018-06-12 15:31:17 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2010-06-06 20:42:10 -04:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2007-05-08 00:23:16 -07:00
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-06-04 11:30:02 +02:00
|
|
|
|
2012-10-20 12:02:59 +02:00
|
|
|
|
2012-10-06 10:31:13 +02:00
|
|
|
|
2010-06-04 11:30:02 +02:00
|
|
|
|
2023-01-13 12:49:11 +01:00
|
|
|
|
2010-06-04 11:30:02 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2007-02-12 00:55:39 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-02-12 00:55:39 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-27 11:03:58 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-17 10:20:54 -05:00
|
|
|
|
2015-12-29 15:58:39 -05:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-11-17 10:20:54 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-29 15:58:39 -05:00
|
|
|
|
2010-06-06 21:51:16 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-18 06:21:10 -04:00
|
|
|
|
2010-06-06 21:51:16 -04:00
|
|
|
|
|
|
|
|
|
2010-06-06 23:16:34 -04:00
|
|
|
|
2010-06-06 21:51:16 -04:00
|
|
|
|
|
|
|
|
|
2015-12-29 15:58:39 -05:00
|
|
|
|
2015-05-02 13:32:22 -04:00
|
|
|
|
2010-06-06 21:51:16 -04:00
|
|
|
|
|
|
|
|
|
2015-05-02 13:32:22 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-06-06 21:51:16 -04:00
|
|
|
|
2015-12-29 15:58:39 -05:00
|
|
|
|
|
|
|
|
|
2010-06-06 21:51:16 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-17 10:20:54 -05:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2024-05-30 20:01:11 +08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2024-05-30 20:01:11 +08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-02-23 20:55:05 -05:00
|
|
|
|
2009-06-30 11:41:44 -07:00
|
|
|
|
2021-11-05 09:10:51 +01:00
|
|
|
|
|
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2024-05-30 20:01:11 +08:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
|
|
|
|
|
2010-06-06 18:43:19 -04:00
|
|
|
|
2010-06-06 20:33:12 -04:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-30 20:01:11 +08:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-06 18:43:19 -04:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
|
|
|
|
|
2010-06-06 18:43:19 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2012-01-08 22:15:13 -05:00
|
|
|
|
2007-10-16 01:27:13 -07:00
|
|
|
|
2023-06-12 21:14:25 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2024-07-25 14:51:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-10-11 09:22:35 +00:00
|
|
|
|
2024-07-25 14:51:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-10-11 09:22:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-25 14:51:30 +08:00
|
|
|
|
2025-10-11 09:22:35 +00:00
|
|
|
|
|
|
|
|
|
2024-07-25 14:51:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-10-11 09:22:35 +00:00
|
|
|
|
2024-07-25 14:51:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-10-11 09:22:35 +00:00
|
|
|
|
2024-07-25 14:51:30 +08:00
|
|
|
|
2025-10-11 09:22:35 +00:00
|
|
|
|
|
|
|
|
|
2024-07-25 14:51:30 +08:00
|
|
|
|
2025-10-11 09:22:35 +00:00
|
|
|
|
|
|
|
|
|
2024-07-25 14:51:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-30 20:01:11 +08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2024-05-30 20:01:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-25 14:51:30 +08:00
|
|
|
|
|
|
|
|
|
2024-05-30 20:01:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
2024-05-30 20:01:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-10-11 09:22:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-30 20:01:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2010-06-06 17:53:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2024-05-30 20:01:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-03-11 07:05:42 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-13 21:31:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-08 00:23:18 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-13 21:31:55 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-02 13:27:34 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|