Skip to content

Commit b49b823

Browse files
committed
Merge remote-tracking branch 'stable/linux-6.7.y' into v6.7+
2 parents 092a5de + 01e08e5 commit b49b823

414 files changed

Lines changed: 4902 additions & 2617 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/ABI/testing/sysfs-class-devfreq

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ Description:
5252

5353
echo 0 > /sys/class/devfreq/.../trans_stat
5454

55+
If the transition table is bigger than PAGE_SIZE, reading
56+
this will return an -EFBIG error.
57+
5558
What: /sys/class/devfreq/.../available_frequencies
5659
Date: October 2012
5760
Contact: Nishanth Menon <[email protected]>

Documentation/admin-guide/abi-obsolete.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ marked to be removed at some later point in time.
77
The description of the interface will document the reason why it is
88
obsolete and when it can be expected to be removed.
99

10-
.. kernel-abi:: $srctree/Documentation/ABI/obsolete
10+
.. kernel-abi:: ABI/obsolete
1111
:rst:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ABI removed symbols
22
===================
33

4-
.. kernel-abi:: $srctree/Documentation/ABI/removed
4+
.. kernel-abi:: ABI/removed
55
:rst:

Documentation/admin-guide/abi-stable.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ for at least 2 years.
1010
Most interfaces (like syscalls) are expected to never change and always
1111
be available.
1212

13-
.. kernel-abi:: $srctree/Documentation/ABI/stable
13+
.. kernel-abi:: ABI/stable
1414
:rst:

Documentation/admin-guide/abi-testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ Programs that use these interfaces are strongly encouraged to add their
1616
name to the description of these interfaces, so that the kernel
1717
developers can easily notify them if any changes occur.
1818

19-
.. kernel-abi:: $srctree/Documentation/ABI/testing
19+
.. kernel-abi:: ABI/testing
2020
:rst:

Documentation/arch/arm64/silicon-errata.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ stable kernels.
7171
+----------------+-----------------+-----------------+-----------------------------+
7272
| ARM | Cortex-A510 | #2658417 | ARM64_ERRATUM_2658417 |
7373
+----------------+-----------------+-----------------+-----------------------------+
74+
| ARM | Cortex-A510 | #3117295 | ARM64_ERRATUM_3117295 |
75+
+----------------+-----------------+-----------------+-----------------------------+
7476
| ARM | Cortex-A520 | #2966298 | ARM64_ERRATUM_2966298 |
7577
+----------------+-----------------+-----------------+-----------------------------+
7678
| ARM | Cortex-A53 | #826319 | ARM64_ERRATUM_826319 |

Documentation/filesystems/directory-locking.rst

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ exclusive.
2222
3) object removal. Locking rules: caller locks parent, finds victim,
2323
locks victim and calls the method. Locks are exclusive.
2424

25-
4) rename() that is _not_ cross-directory. Locking rules: caller locks the
26-
parent and finds source and target. We lock both (provided they exist). If we
27-
need to lock two inodes of different type (dir vs non-dir), we lock directory
28-
first. If we need to lock two inodes of the same type, lock them in inode
29-
pointer order. Then call the method. All locks are exclusive.
30-
NB: we might get away with locking the source (and target in exchange
31-
case) shared.
25+
4) rename() that is _not_ cross-directory. Locking rules: caller locks
26+
the parent and finds source and target. Then we decide which of the
27+
source and target need to be locked. Source needs to be locked if it's a
28+
non-directory; target - if it's a non-directory or about to be removed.
29+
Take the locks that need to be taken, in inode pointer order if need
30+
to take both (that can happen only when both source and target are
31+
non-directories - the source because it wouldn't be locked otherwise
32+
and the target because mixing directory and non-directory is allowed
33+
only with RENAME_EXCHANGE, and that won't be removing the target).
34+
After the locks had been taken, call the method. All locks are exclusive.
3235

3336
5) link creation. Locking rules:
3437

@@ -44,20 +47,17 @@ rules:
4447

4548
* lock the filesystem
4649
* lock parents in "ancestors first" order. If one is not ancestor of
47-
the other, lock them in inode pointer order.
50+
the other, lock the parent of source first.
4851
* find source and target.
4952
* if old parent is equal to or is a descendent of target
5053
fail with -ENOTEMPTY
5154
* if new parent is equal to or is a descendent of source
5255
fail with -ELOOP
53-
* Lock both the source and the target provided they exist. If we
54-
need to lock two inodes of different type (dir vs non-dir), we lock
55-
the directory first. If we need to lock two inodes of the same type,
56-
lock them in inode pointer order.
56+
* Lock subdirectories involved (source before target).
57+
* Lock non-directories involved, in inode pointer order.
5758
* call the method.
5859

59-
All ->i_rwsem are taken exclusive. Again, we might get away with locking
60-
the source (and target in exchange case) shared.
60+
All ->i_rwsem are taken exclusive.
6161

6262
The rules above obviously guarantee that all directories that are going to be
6363
read, modified or removed by method will be locked by caller.
@@ -67,6 +67,7 @@ If no directory is its own ancestor, the scheme above is deadlock-free.
6767

6868
Proof:
6969

70+
[XXX: will be updated once we are done massaging the lock_rename()]
7071
First of all, at any moment we have a linear ordering of the
7172
objects - A < B iff (A is an ancestor of B) or (B is not an ancestor
7273
of A and ptr(A) < ptr(B)).

Documentation/filesystems/locking.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ symlink: exclusive
101101
mkdir: exclusive
102102
unlink: exclusive (both)
103103
rmdir: exclusive (both)(see below)
104-
rename: exclusive (all) (see below)
104+
rename: exclusive (both parents, some children) (see below)
105105
readlink: no
106106
get_link: no
107107
setattr: exclusive
@@ -123,6 +123,9 @@ get_offset_ctx no
123123
Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_rwsem
124124
exclusive on victim.
125125
cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem.
126+
->unlink() and ->rename() have ->i_rwsem exclusive on all non-directories
127+
involved.
128+
->rename() has ->i_rwsem exclusive on any subdirectory that changes parent.
126129

127130
See Documentation/filesystems/directory-locking.rst for more detailed discussion
128131
of the locking scheme for directory operations.

Documentation/filesystems/overlayfs.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ filesystem, an overlay filesystem needs to record in the upper filesystem
145145
that files have been removed. This is done using whiteouts and opaque
146146
directories (non-directories are always opaque).
147147

148-
A whiteout is created as a character device with 0/0 device number.
148+
A whiteout is created as a character device with 0/0 device number or
149+
as a zero-size regular file with the xattr "trusted.overlay.whiteout".
150+
149151
When a whiteout is found in the upper level of a merged directory, any
150152
matching name in the lower level is ignored, and the whiteout itself
151153
is also hidden.
@@ -154,6 +156,13 @@ A directory is made opaque by setting the xattr "trusted.overlay.opaque"
154156
to "y". Where the upper filesystem contains an opaque directory, any
155157
directory in the lower filesystem with the same name is ignored.
156158

159+
An opaque directory should not conntain any whiteouts, because they do not
160+
serve any purpose. A merge directory containing regular files with the xattr
161+
"trusted.overlay.whiteout", should be additionally marked by setting the xattr
162+
"trusted.overlay.opaque" to "x" on the merge directory itself.
163+
This is needed to avoid the overhead of checking the "trusted.overlay.whiteout"
164+
on all entries during readdir in the common case.
165+
157166
readdir
158167
-------
159168

@@ -534,8 +543,9 @@ A lower dir with a regular whiteout will always be handled by the overlayfs
534543
mount, so to support storing an effective whiteout file in an overlayfs mount an
535544
alternative form of whiteout is supported. This form is a regular, zero-size
536545
file with the "overlay.whiteout" xattr set, inside a directory with the
537-
"overlay.whiteouts" xattr set. Such whiteouts are never created by overlayfs,
538-
but can be used by userspace tools (like containers) that generate lower layers.
546+
"overlay.opaque" xattr set to "x" (see `whiteouts and opaque directories`_).
547+
These alternative whiteouts are never created by overlayfs, but can be used by
548+
userspace tools (like containers) that generate lower layers.
539549
These alternative whiteouts can be escaped using the standard xattr escape
540550
mechanism in order to properly nest to any depth.
541551

Documentation/filesystems/porting.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,3 +1061,21 @@ export_operations ->encode_fh() no longer has a default implementation to
10611061
encode FILEID_INO32_GEN* file handles.
10621062
Filesystems that used the default implementation may use the generic helper
10631063
generic_encode_ino32_fh() explicitly.
1064+
1065+
---
1066+
1067+
**mandatory**
1068+
1069+
If ->rename() update of .. on cross-directory move needs an exclusion with
1070+
directory modifications, do *not* lock the subdirectory in question in your
1071+
->rename() - it's done by the caller now [that item should've been added in
1072+
28eceeda130f "fs: Lock moved directories"].
1073+
1074+
---
1075+
1076+
**mandatory**
1077+
1078+
On same-directory ->rename() the (tautological) update of .. is not protected
1079+
by any locks; just don't do it if the old parent is the same as the new one.
1080+
We really can't lock two subdirectories in same-directory rename - not without
1081+
deadlocks.

0 commit comments

Comments
 (0)