License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 15:07:57 +01:00
|
|
|
|
2010-04-06 15:14:15 -07:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2010-04-06 15:14:15 -07:00
|
|
|
|
2009-10-06 11:31:08 -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
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2012-07-31 11:27:36 -07:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
2019-06-06 08:57:27 -04:00
|
|
|
|
2020-03-19 23:45:01 -04:00
|
|
|
|
2023-11-30 16:16:22 +02:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-21 17:29:54 -04:00
|
|
|
|
ceph: add buffered/direct exclusionary locking for reads and writes
xfstest generic/451 intermittently fails. The test does O_DIRECT writes
to a file, and then reads back the result using buffered I/O, while
running a separate set of tasks that are also doing buffered reads.
The client will invalidate the cache prior to a direct write, but it's
easy for one of the other readers' replies to race in and reinstantiate
the invalidated range with stale data.
To fix this, we must to serialize direct I/O writes and buffered reads.
We could just sprinkle in some shared locks on the i_rwsem for reads,
and increase the exclusive footprint on the write side, but that would
cause O_DIRECT writes to end up serialized vs. other direct requests.
Instead, borrow the scheme used by nfs.ko. Buffered writes take the
i_rwsem exclusively, but buffered reads take a shared lock, allowing
them to run in parallel.
O_DIRECT requests also take a shared lock, but we need for them to not
run in parallel with buffered reads. A flag on the ceph_inode_info is
used to indicate whether it's in direct or buffered I/O mode. When a
conflicting request is submitted, it will block until the inode can be
flipped to the necessary mode.
Link: https://tracker.ceph.com/issues/40985
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2019-08-02 13:15:39 -04:00
|
|
|
|
2020-03-19 23:45:01 -04:00
|
|
|
|
2026-02-10 09:06:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2017-04-27 18:34:00 +02:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2017-04-27 18:34:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-09 15:12:40 +08:00
|
|
|
|
|
|
|
|
|
2017-04-27 18:34:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2017-04-27 18:34:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-08 15:26:15 +08:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
2015-10-08 15:26:15 +08:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
2015-10-08 15:26:15 +08:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-09 10:28:36 -04:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-03 16:06:23 +01:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
2023-02-03 16:06:23 +01:00
|
|
|
|
|
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-08 15:26:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-08 15:26:15 +08:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
2015-10-08 15:26:15 +08:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-08 15:26:15 +08:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-08 15:26:15 +08:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:
Single allocations: kmalloc(sizeof(TYPE), ...)
are replaced with: kmalloc_obj(TYPE, ...)
Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with: kmalloc_objs(TYPE, COUNT, ...)
Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)
(where TYPE may also be *VAR)
The resulting allocations no longer return "void *", instead returning
"TYPE *".
Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-20 23:49:23 -08:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
2015-10-08 15:26:15 +08:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-08 15:26:15 +08:00
|
|
|
|
|
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-10-08 15:26:15 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-03 09:01:39 -04:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-25 20:16:42 +08:00
|
|
|
|
2021-11-30 14:12:13 -05:00
|
|
|
|
2023-06-12 10:50:38 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
2021-12-15 23:48:33 +00:00
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-05 20:21:02 +08:00
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-05 20:21:02 +08:00
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
|
|
|
|
|
2021-11-30 14:12:13 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-05 20:21:02 +08:00
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
2020-03-05 20:21:02 +08:00
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
|
|
|
|
|
2023-06-12 10:50:38 +08:00
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
2022-06-07 10:13:53 +08:00
|
|
|
|
2021-12-15 23:48:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
2021-12-15 23:48:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-07 08:44:50 -05:00
|
|
|
|
2020-08-23 17:36:59 -05:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-08 15:27:16 +08:00
|
|
|
|
ceph: fix hanging __ceph_get_caps() with stale mds_wanted
A reader can hang forever in __ceph_get_caps() when the client no
longer holds `FILE_RD`, but local cap state still says that the
capability is already wanted (via `mds_wanted`).
One way to trigger this is through MDS cap revocation. If another
client performs a conflicting operation, the MDS can revoke `FILE_RD`
from the reader; the next read then has to reacquire `FILE_RD`. If
the cap update that should request `FILE_RD` never reaches the MDS
after `cap->mds_wanted` was raised, the reader is left holding only
non-file caps while local `mds_wanted` still includes the file read
caps.
In that state, try_get_cap_refs() sees `need <= mds_wanted` and
returns 0, so __ceph_get_caps() just waits on `i_cap_wq`. If the cap
update that was supposed to request `FILE_RD never reaches the MDS
after `cap->mds_wanted was` raised, no further request is sent and the
waiter can sleep indefinitely until unrelated cap traffic happens to
wake it up.
The ordering issue is that `cap->mds_wanted` is updated in
__prep_cap() before the `CEPH_MSG_CLIENT_CAPS message` is actually
queued for send. That makes one field serve two different meanings at
once: what this client wants, and what the client believes the MDS
already knows it wants.
A proper fix would be to split those states and track whether a cap
update is actually in flight or has been observed by the MDS.
However, simply moving the `cap->mds_wanted assignment` later would
not be sufficient: queueing the message in the messenger does not
guarantee that the MDS processed that specific wanted set, and
reconnect or message loss can still invalidate that assumption.
Fixing that properly would require a larger rework of the cap state
machine.
To allow simpler backports to stable kernels, this patch implements a
simpler workaround:
- stop waiting forever in __ceph_get_caps(); after a bounded wait,
fall back to the renew path
- make ceph_renew_caps() issue a synchronous `OPEN` request whenever
the inode still does not actually hold the wanted caps, instead of
only calling ceph_check_caps()
The extra issued-vs-wanted check in ceph_renew_caps() is necessary
because the previous test only checked whether the inode still had any
real caps at all. That is not enough after revocation: the client can
still hold something like `pLs` and yet be missing `FILE_RD`
completely. In that case, falling back to ceph_check_caps() is not
sufficient, because it still trusts `cap->mds_wanted` and may resend
nothing. By requiring `(issued & wanted) == wanted` before taking the
asynchronous path, the code only uses ceph_check_caps() when the
`wanted caps` are already actually issued. Otherwise, it sends the
synchronous `OPEN` renew.
This preserves the existing asynchronous fast path when the wanted
caps are already issued, avoids changing cap-state semantics, and
fixes the hang by guaranteeing that a stalled waiter eventually
retries through a path that does not rely on the stale `mds_wanted`
state.
[ idryomov: move CEPH_GET_CAPS_WAIT_TIMEOUT from libceph.h to
mds_client.h, formatting ]
Cc: stable@vger.kernel.org
Fixes: 0a454bdd501a ("ceph: reorganize __send_cap for less spinlock abuse")
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Reviewed-by: Alex Markuze <amarkuze@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2026-07-06 17:06:59 +02:00
|
|
|
|
2016-04-08 15:27:16 +08:00
|
|
|
|
2020-03-05 20:21:00 +08:00
|
|
|
|
2016-04-08 15:27:16 +08:00
|
|
|
|
2020-09-03 09:01:39 -04:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2016-04-08 15:27:16 +08:00
|
|
|
|
|
|
|
|
|
ceph: fix hanging __ceph_get_caps() with stale mds_wanted
A reader can hang forever in __ceph_get_caps() when the client no
longer holds `FILE_RD`, but local cap state still says that the
capability is already wanted (via `mds_wanted`).
One way to trigger this is through MDS cap revocation. If another
client performs a conflicting operation, the MDS can revoke `FILE_RD`
from the reader; the next read then has to reacquire `FILE_RD`. If
the cap update that should request `FILE_RD` never reaches the MDS
after `cap->mds_wanted` was raised, the reader is left holding only
non-file caps while local `mds_wanted` still includes the file read
caps.
In that state, try_get_cap_refs() sees `need <= mds_wanted` and
returns 0, so __ceph_get_caps() just waits on `i_cap_wq`. If the cap
update that was supposed to request `FILE_RD never reaches the MDS
after `cap->mds_wanted was` raised, no further request is sent and the
waiter can sleep indefinitely until unrelated cap traffic happens to
wake it up.
The ordering issue is that `cap->mds_wanted` is updated in
__prep_cap() before the `CEPH_MSG_CLIENT_CAPS message` is actually
queued for send. That makes one field serve two different meanings at
once: what this client wants, and what the client believes the MDS
already knows it wants.
A proper fix would be to split those states and track whether a cap
update is actually in flight or has been observed by the MDS.
However, simply moving the `cap->mds_wanted assignment` later would
not be sufficient: queueing the message in the messenger does not
guarantee that the MDS processed that specific wanted set, and
reconnect or message loss can still invalidate that assumption.
Fixing that properly would require a larger rework of the cap state
machine.
To allow simpler backports to stable kernels, this patch implements a
simpler workaround:
- stop waiting forever in __ceph_get_caps(); after a bounded wait,
fall back to the renew path
- make ceph_renew_caps() issue a synchronous `OPEN` request whenever
the inode still does not actually hold the wanted caps, instead of
only calling ceph_check_caps()
The extra issued-vs-wanted check in ceph_renew_caps() is necessary
because the previous test only checked whether the inode still had any
real caps at all. That is not enough after revocation: the client can
still hold something like `pLs` and yet be missing `FILE_RD`
completely. In that case, falling back to ceph_check_caps() is not
sufficient, because it still trusts `cap->mds_wanted` and may resend
nothing. By requiring `(issued & wanted) == wanted` before taking the
asynchronous path, the code only uses ceph_check_caps() when the
`wanted caps` are already actually issued. Otherwise, it sends the
synchronous `OPEN` renew.
This preserves the existing asynchronous fast path when the wanted
caps are already issued, avoids changing cap-state semantics, and
fixes the hang by guaranteeing that a stalled waiter eventually
retries through a path that does not rely on the stale `mds_wanted`
state.
[ idryomov: move CEPH_GET_CAPS_WAIT_TIMEOUT from libceph.h to
mds_client.h, formatting ]
Cc: stable@vger.kernel.org
Fixes: 0a454bdd501a ("ceph: reorganize __send_cap for less spinlock abuse")
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Reviewed-by: Alex Markuze <amarkuze@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2026-07-06 17:06:59 +02:00
|
|
|
|
2016-04-08 15:27:16 +08:00
|
|
|
|
|
|
|
|
|
2020-03-05 20:21:00 +08:00
|
|
|
|
2016-04-08 15:27:16 +08:00
|
|
|
|
ceph: fix hanging __ceph_get_caps() with stale mds_wanted
A reader can hang forever in __ceph_get_caps() when the client no
longer holds `FILE_RD`, but local cap state still says that the
capability is already wanted (via `mds_wanted`).
One way to trigger this is through MDS cap revocation. If another
client performs a conflicting operation, the MDS can revoke `FILE_RD`
from the reader; the next read then has to reacquire `FILE_RD`. If
the cap update that should request `FILE_RD` never reaches the MDS
after `cap->mds_wanted` was raised, the reader is left holding only
non-file caps while local `mds_wanted` still includes the file read
caps.
In that state, try_get_cap_refs() sees `need <= mds_wanted` and
returns 0, so __ceph_get_caps() just waits on `i_cap_wq`. If the cap
update that was supposed to request `FILE_RD never reaches the MDS
after `cap->mds_wanted was` raised, no further request is sent and the
waiter can sleep indefinitely until unrelated cap traffic happens to
wake it up.
The ordering issue is that `cap->mds_wanted` is updated in
__prep_cap() before the `CEPH_MSG_CLIENT_CAPS message` is actually
queued for send. That makes one field serve two different meanings at
once: what this client wants, and what the client believes the MDS
already knows it wants.
A proper fix would be to split those states and track whether a cap
update is actually in flight or has been observed by the MDS.
However, simply moving the `cap->mds_wanted assignment` later would
not be sufficient: queueing the message in the messenger does not
guarantee that the MDS processed that specific wanted set, and
reconnect or message loss can still invalidate that assumption.
Fixing that properly would require a larger rework of the cap state
machine.
To allow simpler backports to stable kernels, this patch implements a
simpler workaround:
- stop waiting forever in __ceph_get_caps(); after a bounded wait,
fall back to the renew path
- make ceph_renew_caps() issue a synchronous `OPEN` request whenever
the inode still does not actually hold the wanted caps, instead of
only calling ceph_check_caps()
The extra issued-vs-wanted check in ceph_renew_caps() is necessary
because the previous test only checked whether the inode still had any
real caps at all. That is not enough after revocation: the client can
still hold something like `pLs` and yet be missing `FILE_RD`
completely. In that case, falling back to ceph_check_caps() is not
sufficient, because it still trusts `cap->mds_wanted` and may resend
nothing. By requiring `(issued & wanted) == wanted` before taking the
asynchronous path, the code only uses ceph_check_caps() when the
`wanted caps` are already actually issued. Otherwise, it sends the
synchronous `OPEN` renew.
This preserves the existing asynchronous fast path when the wanted
caps are already issued, avoids changing cap-state semantics, and
fixes the hang by guaranteeing that a stalled waiter eventually
retries through a path that does not rely on the stale `mds_wanted`
state.
[ idryomov: move CEPH_GET_CAPS_WAIT_TIMEOUT from libceph.h to
mds_client.h, formatting ]
Cc: stable@vger.kernel.org
Fixes: 0a454bdd501a ("ceph: reorganize __send_cap for less spinlock abuse")
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Reviewed-by: Alex Markuze <amarkuze@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2026-07-06 17:06:59 +02:00
|
|
|
|
2016-04-08 15:27:16 +08:00
|
|
|
|
ceph: fix hanging __ceph_get_caps() with stale mds_wanted
A reader can hang forever in __ceph_get_caps() when the client no
longer holds `FILE_RD`, but local cap state still says that the
capability is already wanted (via `mds_wanted`).
One way to trigger this is through MDS cap revocation. If another
client performs a conflicting operation, the MDS can revoke `FILE_RD`
from the reader; the next read then has to reacquire `FILE_RD`. If
the cap update that should request `FILE_RD` never reaches the MDS
after `cap->mds_wanted` was raised, the reader is left holding only
non-file caps while local `mds_wanted` still includes the file read
caps.
In that state, try_get_cap_refs() sees `need <= mds_wanted` and
returns 0, so __ceph_get_caps() just waits on `i_cap_wq`. If the cap
update that was supposed to request `FILE_RD never reaches the MDS
after `cap->mds_wanted was` raised, no further request is sent and the
waiter can sleep indefinitely until unrelated cap traffic happens to
wake it up.
The ordering issue is that `cap->mds_wanted` is updated in
__prep_cap() before the `CEPH_MSG_CLIENT_CAPS message` is actually
queued for send. That makes one field serve two different meanings at
once: what this client wants, and what the client believes the MDS
already knows it wants.
A proper fix would be to split those states and track whether a cap
update is actually in flight or has been observed by the MDS.
However, simply moving the `cap->mds_wanted assignment` later would
not be sufficient: queueing the message in the messenger does not
guarantee that the MDS processed that specific wanted set, and
reconnect or message loss can still invalidate that assumption.
Fixing that properly would require a larger rework of the cap state
machine.
To allow simpler backports to stable kernels, this patch implements a
simpler workaround:
- stop waiting forever in __ceph_get_caps(); after a bounded wait,
fall back to the renew path
- make ceph_renew_caps() issue a synchronous `OPEN` request whenever
the inode still does not actually hold the wanted caps, instead of
only calling ceph_check_caps()
The extra issued-vs-wanted check in ceph_renew_caps() is necessary
because the previous test only checked whether the inode still had any
real caps at all. That is not enough after revocation: the client can
still hold something like `pLs` and yet be missing `FILE_RD`
completely. In that case, falling back to ceph_check_caps() is not
sufficient, because it still trusts `cap->mds_wanted` and may resend
nothing. By requiring `(issued & wanted) == wanted` before taking the
asynchronous path, the code only uses ceph_check_caps() when the
`wanted caps` are already actually issued. Otherwise, it sends the
synchronous `OPEN` renew.
This preserves the existing asynchronous fast path when the wanted
caps are already issued, avoids changing cap-state semantics, and
fixes the hang by guaranteeing that a stalled waiter eventually
retries through a path that does not rely on the stale `mds_wanted`
state.
[ idryomov: move CEPH_GET_CAPS_WAIT_TIMEOUT from libceph.h to
mds_client.h, formatting ]
Cc: stable@vger.kernel.org
Fixes: 0a454bdd501a ("ceph: reorganize __send_cap for less spinlock abuse")
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Reviewed-by: Alex Markuze <amarkuze@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2026-07-06 17:06:59 +02:00
|
|
|
|
|
|
|
|
|
2016-04-08 15:27:16 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-18 09:03:29 +08:00
|
|
|
|
2016-04-08 15:27:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2016-04-08 15:27:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 10:50:38 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2010-04-06 15:14:15 -07:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2018-02-28 19:43:47 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
2023-11-08 10:54:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2018-02-28 19:43:47 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-07-01 14:40:51 -04:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2021-07-01 14:40:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-08 10:54:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-24 14:10:29 +01:00
|
|
|
|
2025-08-12 09:57:38 +00:00
|
|
|
|
2023-11-08 10:54:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-08-12 09:57:38 +00:00
|
|
|
|
2023-11-08 10:54:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-07 09:07:15 -08:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
2011-11-30 09:47:09 -08:00
|
|
|
|
2023-11-08 10:54:35 +08:00
|
|
|
|
2010-11-07 09:07:15 -08:00
|
|
|
|
2017-01-29 22:15:47 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-05 20:21:02 +08:00
|
|
|
|
2011-11-30 09:47:09 -08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-18 09:03:29 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
2023-11-08 10:54:35 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2020-03-05 20:21:00 +08:00
|
|
|
|
2011-11-30 09:47:09 -08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
2013-08-21 17:29:54 -04:00
|
|
|
|
2011-11-30 09:47:09 -08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-27 09:24:26 -07:00
|
|
|
|
|
|
|
|
|
2013-08-21 17:29:54 -04:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2015-08-18 10:25:35 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-02 07:11:38 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-04 21:22:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-08 10:27:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-17 22:17:35 +08:00
|
|
|
|
2022-02-08 10:27:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-05-07 08:05:30 +00:00
|
|
|
|
|
|
|
|
|
2022-10-17 22:17:35 +08:00
|
|
|
|
2026-05-07 08:05:30 +00:00
|
|
|
|
|
|
|
|
|
2022-10-17 22:17:35 +08:00
|
|
|
|
2022-02-08 10:27:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-17 22:17:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-08 10:27:50 -05:00
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2022-02-08 10:27:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-08 10:27:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-08-12 09:57:38 +00:00
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2025-08-12 09:57:38 +00:00
|
|
|
|
|
|
|
|
|
2022-02-08 10:27:50 -05:00
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-08 10:27:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
2022-02-08 10:27:50 -05:00
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
2022-02-08 10:27:50 -05:00
|
|
|
|
|
|
|
|
|
2021-09-02 09:12:35 -04:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ceph: preallocate inode for ops that may create one
When creating a new inode, we need to determine the crypto context
before we can transmit the RPC. The fscrypt API has a routine for getting
a crypto context before a create occurs, but it requires an inode.
Change the ceph code to preallocate an inode in advance of a create of
any sort (open(), mknod(), symlink(), etc). Move the existing code that
generates the ACL and SELinux blobs into this routine since that's
mostly common across all the different codepaths.
In most cases, we just want to allow ceph_fill_trace to use that inode
after the reply comes in, so add a new field to the MDS request for it
(r_new_inode).
The async create codepath is a bit different though. In that case, we
want to hash the inode in advance of the RPC so that it can be used
before the reply comes in. If the call subsequently fails with
-EJUKEBOX, then just put the references and clean up the as_ctx. Note
that with this change, we now need to regenerate the as_ctx when this
occurs, but it's quite rare for it to happen.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-08-26 13:11:00 -04:00
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-10 09:53:21 +08:00
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
2022-01-26 12:36:49 -05:00
|
|
|
|
2021-06-01 09:40:25 -04:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-25 15:54:27 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-07 15:26:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-29 12:16:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-07 15:26:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-29 12:16:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-01-26 12:36:49 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
2021-06-01 09:40:25 -04:00
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
2021-06-01 09:40:25 -04:00
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ceph: preallocate inode for ops that may create one
When creating a new inode, we need to determine the crypto context
before we can transmit the RPC. The fscrypt API has a routine for getting
a crypto context before a create occurs, but it requires an inode.
Change the ceph code to preallocate an inode in advance of a create of
any sort (open(), mknod(), symlink(), etc). Move the existing code that
generates the ACL and SELinux blobs into this routine since that's
mostly common across all the different codepaths.
In most cases, we just want to allow ceph_fill_trace to use that inode
after the reply comes in, so add a new field to the MDS request for it
(r_new_inode).
The async create codepath is a bit different though. In that case, we
want to hash the inode in advance of the RPC so that it can be used
before the reply comes in. If the call subsequently fails with
-EJUKEBOX, then just put the references and clean up the as_ctx. Note
that with this change, we now need to regenerate the as_ctx when this
occurs, but it's quite rare for it to happen.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-08-26 13:11:00 -04:00
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
2025-10-09 09:59:21 +02:00
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-05-07 08:05:30 +00:00
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-10 09:53:21 +08:00
|
|
|
|
|
|
|
|
|
2025-07-08 12:20:57 -07:00
|
|
|
|
2022-06-10 09:53:21 +08:00
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2012-07-31 11:27:36 -07:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2012-07-31 11:27:36 -07:00
|
|
|
|
2018-06-08 13:32:02 -04:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2023-08-07 15:26:25 +02:00
|
|
|
|
2023-06-12 10:50:38 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2010-04-06 15:14:15 -07:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
ceph: preallocate inode for ops that may create one
When creating a new inode, we need to determine the crypto context
before we can transmit the RPC. The fscrypt API has a routine for getting
a crypto context before a create occurs, but it requires an inode.
Change the ceph code to preallocate an inode in advance of a create of
any sort (open(), mknod(), symlink(), etc). Move the existing code that
generates the ACL and SELinux blobs into this routine since that's
mostly common across all the different codepaths.
In most cases, we just want to allow ceph_fill_trace to use that inode
after the reply comes in, so add a new field to the MDS request for it
(r_new_inode).
The async create codepath is a bit different though. In that case, we
want to hash the inode in advance of the RPC so that it can be used
before the reply comes in. If the call subsequently fails with
-EJUKEBOX, then just put the references and clean up the as_ctx. Note
that with this change, we now need to regenerate the as_ctx when this
occurs, but it's quite rare for it to happen.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-08-26 13:11:00 -04:00
|
|
|
|
2012-07-31 11:27:36 -07:00
|
|
|
|
2019-05-26 15:35:39 +08:00
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
2018-01-05 10:47:19 +00:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2023-11-08 11:06:05 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-31 11:27:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-10 09:47:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-01 10:52:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-10 09:47:01 +08:00
|
|
|
|
2023-11-08 11:06:05 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-24 14:10:29 +01:00
|
|
|
|
2025-08-12 09:57:38 +00:00
|
|
|
|
2023-11-08 11:06:05 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-08-12 09:57:38 +00:00
|
|
|
|
2023-11-08 11:06:05 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ceph: preallocate inode for ops that may create one
When creating a new inode, we need to determine the crypto context
before we can transmit the RPC. The fscrypt API has a routine for getting
a crypto context before a create occurs, but it requires an inode.
Change the ceph code to preallocate an inode in advance of a create of
any sort (open(), mknod(), symlink(), etc). Move the existing code that
generates the ACL and SELinux blobs into this routine since that's
mostly common across all the different codepaths.
In most cases, we just want to allow ceph_fill_trace to use that inode
after the reply comes in, so add a new field to the MDS request for it
(r_new_inode).
The async create codepath is a bit different though. In that case, we
want to hash the inode in advance of the RPC so that it can be used
before the reply comes in. If the call subsequently fails with
-EJUKEBOX, then just put the references and clean up the as_ctx. Note
that with this change, we now need to regenerate the as_ctx when this
occurs, but it's quite rare for it to happen.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-08-26 13:11:00 -04:00
|
|
|
|
2014-09-16 20:35:17 +08:00
|
|
|
|
2018-01-05 10:47:19 +00:00
|
|
|
|
|
|
|
|
|
ceph: preallocate inode for ops that may create one
When creating a new inode, we need to determine the crypto context
before we can transmit the RPC. The fscrypt API has a routine for getting
a crypto context before a create occurs, but it requires an inode.
Change the ceph code to preallocate an inode in advance of a create of
any sort (open(), mknod(), symlink(), etc). Move the existing code that
generates the ACL and SELinux blobs into this routine since that's
mostly common across all the different codepaths.
In most cases, we just want to allow ceph_fill_trace to use that inode
after the reply comes in, so add a new field to the MDS request for it
(r_new_inode).
The async create codepath is a bit different though. In that case, we
want to hash the inode in advance of the RPC so that it can be used
before the reply comes in. If the call subsequently fails with
-EJUKEBOX, then just put the references and clean up the as_ctx. Note
that with this change, we now need to regenerate the as_ctx when this
occurs, but it's quite rare for it to happen.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-08-26 13:11:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-26 16:27:56 +08:00
|
|
|
|
ceph: preallocate inode for ops that may create one
When creating a new inode, we need to determine the crypto context
before we can transmit the RPC. The fscrypt API has a routine for getting
a crypto context before a create occurs, but it requires an inode.
Change the ceph code to preallocate an inode in advance of a create of
any sort (open(), mknod(), symlink(), etc). Move the existing code that
generates the ACL and SELinux blobs into this routine since that's
mostly common across all the different codepaths.
In most cases, we just want to allow ceph_fill_trace to use that inode
after the reply comes in, so add a new field to the MDS request for it
(r_new_inode).
The async create codepath is a bit different though. In that case, we
want to hash the inode in advance of the RPC so that it can be used
before the reply comes in. If the call subsequently fails with
-EJUKEBOX, then just put the references and clean up the as_ctx. Note
that with this change, we now need to regenerate the as_ctx when this
occurs, but it's quite rare for it to happen.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-08-26 13:11:00 -04:00
|
|
|
|
2022-04-25 15:54:27 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-30 12:15:10 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-16 20:35:17 +08:00
|
|
|
|
ceph: preallocate inode for ops that may create one
When creating a new inode, we need to determine the crypto context
before we can transmit the RPC. The fscrypt API has a routine for getting
a crypto context before a create occurs, but it requires an inode.
Change the ceph code to preallocate an inode in advance of a create of
any sort (open(), mknod(), symlink(), etc). Move the existing code that
generates the ACL and SELinux blobs into this routine since that's
mostly common across all the different codepaths.
In most cases, we just want to allow ceph_fill_trace to use that inode
after the reply comes in, so add a new field to the MDS request for it
(r_new_inode).
The async create codepath is a bit different though. In that case, we
want to hash the inode in advance of the RPC so that it can be used
before the reply comes in. If the call subsequently fails with
-EJUKEBOX, then just put the references and clean up the as_ctx. Note
that with this change, we now need to regenerate the as_ctx when this
occurs, but it's quite rare for it to happen.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-08-26 13:11:00 -04:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
2014-09-16 20:35:17 +08:00
|
|
|
|
|
|
|
|
|
2019-05-26 15:35:39 +08:00
|
|
|
|
2014-09-16 20:35:17 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-07 15:26:25 +02:00
|
|
|
|
|
|
|
|
|
2021-06-18 13:05:06 -04:00
|
|
|
|
2021-01-26 14:12:24 -05:00
|
|
|
|
2022-08-25 09:31:06 -04:00
|
|
|
|
2023-03-16 18:14:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-26 14:12:24 -05:00
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
2023-06-05 14:58:18 +08:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
ceph: preallocate inode for ops that may create one
When creating a new inode, we need to determine the crypto context
before we can transmit the RPC. The fscrypt API has a routine for getting
a crypto context before a create occurs, but it requires an inode.
Change the ceph code to preallocate an inode in advance of a create of
any sort (open(), mknod(), symlink(), etc). Move the existing code that
generates the ACL and SELinux blobs into this routine since that's
mostly common across all the different codepaths.
In most cases, we just want to allow ceph_fill_trace to use that inode
after the reply comes in, so add a new field to the MDS request for it
(r_new_inode).
The async create codepath is a bit different though. In that case, we
want to hash the inode in advance of the RPC so that it can be used
before the reply comes in. If the call subsequently fails with
-EJUKEBOX, then just put the references and clean up the as_ctx. Note
that with this change, we now need to regenerate the as_ctx when this
occurs, but it's quite rare for it to happen.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-08-26 13:11:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-10 09:53:21 +08:00
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-10 09:53:21 +08:00
|
|
|
|
ceph: preallocate inode for ops that may create one
When creating a new inode, we need to determine the crypto context
before we can transmit the RPC. The fscrypt API has a routine for getting
a crypto context before a create occurs, but it requires an inode.
Change the ceph code to preallocate an inode in advance of a create of
any sort (open(), mknod(), symlink(), etc). Move the existing code that
generates the ACL and SELinux blobs into this routine since that's
mostly common across all the different codepaths.
In most cases, we just want to allow ceph_fill_trace to use that inode
after the reply comes in, so add a new field to the MDS request for it
(r_new_inode).
The async create codepath is a bit different though. In that case, we
want to hash the inode in advance of the RPC so that it can be used
before the reply comes in. If the call subsequently fails with
-EJUKEBOX, then just put the references and clean up the as_ctx. Note
that with this change, we now need to regenerate the as_ctx when this
occurs, but it's quite rare for it to happen.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-08-26 13:11:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-10-09 09:59:21 +02:00
|
|
|
|
ceph: preallocate inode for ops that may create one
When creating a new inode, we need to determine the crypto context
before we can transmit the RPC. The fscrypt API has a routine for getting
a crypto context before a create occurs, but it requires an inode.
Change the ceph code to preallocate an inode in advance of a create of
any sort (open(), mknod(), symlink(), etc). Move the existing code that
generates the ACL and SELinux blobs into this routine since that's
mostly common across all the different codepaths.
In most cases, we just want to allow ceph_fill_trace to use that inode
after the reply comes in, so add a new field to the MDS request for it
(r_new_inode).
The async create codepath is a bit different though. In that case, we
want to hash the inode in advance of the RPC so that it can be used
before the reply comes in. If the call subsequently fails with
-EJUKEBOX, then just put the references and clean up the as_ctx. Note
that with this change, we now need to regenerate the as_ctx when this
occurs, but it's quite rare for it to happen.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-08-26 13:11:00 -04:00
|
|
|
|
2022-06-10 09:53:21 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
ceph: preallocate inode for ops that may create one
When creating a new inode, we need to determine the crypto context
before we can transmit the RPC. The fscrypt API has a routine for getting
a crypto context before a create occurs, but it requires an inode.
Change the ceph code to preallocate an inode in advance of a create of
any sort (open(), mknod(), symlink(), etc). Move the existing code that
generates the ACL and SELinux blobs into this routine since that's
mostly common across all the different codepaths.
In most cases, we just want to allow ceph_fill_trace to use that inode
after the reply comes in, so add a new field to the MDS request for it
(r_new_inode).
The async create codepath is a bit different though. In that case, we
want to hash the inode in advance of the RPC so that it can be used
before the reply comes in. If the call subsequently fails with
-EJUKEBOX, then just put the references and clean up the as_ctx. Note
that with this change, we now need to regenerate the as_ctx when this
occurs, but it's quite rare for it to happen.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-08-26 13:11:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ceph: preallocate inode for ops that may create one
When creating a new inode, we need to determine the crypto context
before we can transmit the RPC. The fscrypt API has a routine for getting
a crypto context before a create occurs, but it requires an inode.
Change the ceph code to preallocate an inode in advance of a create of
any sort (open(), mknod(), symlink(), etc). Move the existing code that
generates the ACL and SELinux blobs into this routine since that's
mostly common across all the different codepaths.
In most cases, we just want to allow ceph_fill_trace to use that inode
after the reply comes in, so add a new field to the MDS request for it
(r_new_inode).
The async create codepath is a bit different though. In that case, we
want to hash the inode in advance of the RPC so that it can be used
before the reply comes in. If the call subsequently fails with
-EJUKEBOX, then just put the references and clean up the as_ctx. Note
that with this change, we now need to regenerate the as_ctx when this
occurs, but it's quite rare for it to happen.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-08-26 13:11:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
2022-01-25 15:39:16 -05:00
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
2022-01-25 15:39:16 -05:00
|
|
|
|
2019-11-27 12:06:14 -05:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2016-03-07 10:34:50 +08:00
|
|
|
|
2017-01-31 10:28:26 -05:00
|
|
|
|
ceph: preallocate inode for ops that may create one
When creating a new inode, we need to determine the crypto context
before we can transmit the RPC. The fscrypt API has a routine for getting
a crypto context before a create occurs, but it requires an inode.
Change the ceph code to preallocate an inode in advance of a create of
any sort (open(), mknod(), symlink(), etc). Move the existing code that
generates the ACL and SELinux blobs into this routine since that's
mostly common across all the different codepaths.
In most cases, we just want to allow ceph_fill_trace to use that inode
after the reply comes in, so add a new field to the MDS request for it
(r_new_inode).
The async create codepath is a bit different though. In that case, we
want to hash the inode in advance of the RPC so that it can be used
before the reply comes in. If the call subsequently fails with
-EJUKEBOX, then just put the references and clean up the as_ctx. Note
that with this change, we now need to regenerate the as_ctx when this
occurs, but it's quite rare for it to happen.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-08-26 13:11:00 -04:00
|
|
|
|
|
|
|
|
|
2022-07-01 10:52:27 +08:00
|
|
|
|
2021-06-02 12:46:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-01 08:01:54 -05:00
|
|
|
|
2012-12-19 09:44:23 -10:00
|
|
|
|
2021-06-02 12:46:07 -04:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2012-07-31 11:27:36 -07:00
|
|
|
|
2016-07-05 09:44:53 -04:00
|
|
|
|
2012-07-31 11:27:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-26 11:28:11 -07:00
|
|
|
|
2014-09-16 20:35:17 +08:00
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2012-07-31 11:27:36 -07:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2012-07-31 11:27:36 -07:00
|
|
|
|
|
|
|
|
|
2021-07-01 14:40:51 -04:00
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2021-07-01 14:40:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2012-12-28 09:56:46 -08:00
|
|
|
|
2020-01-02 07:11:38 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-06-08 13:22:02 -04:00
|
|
|
|
2012-12-28 09:56:46 -08:00
|
|
|
|
openat2: new OPENAT2_REGULAR flag support
This flag indicates the path should be opened if it's a regular file.
This is useful to write secure programs that want to avoid being
tricked into opening device nodes with special semantics while thinking
they operate on regular files. This is a requested feature from the
uapi-group[1].
The previously introduced EFTYPE error code is returned when the path
doesn't refer to a regular file. For example, if openat2 is called on
path /dev/null with OPENAT2_REGULAR in the flag param, it will return
-EFTYPE.
When used in combination with O_CREAT, either the regular file is
created, or if the path already exists, it is opened if it's a regular
file. Otherwise, -EFTYPE is returned.
When OPENAT2_REGULAR is combined with O_DIRECTORY, -EINVAL is returned
as it doesn't make sense to open a path that is both a directory and a
regular file.
The UAPI bit lives in the upper 32 bits of open_how::flags
(((__u64)1 << 32)) so that open(2) and openat(2) -- whose @flags
argument is a C int -- cannot physically express it. This is a
structural guarantee, not a runtime mask: the bit is unrepresentable in
32 bits.
Because the rest of the VFS open path narrows to 32 bits in several
places (op->open_flag, f->f_flags, the unsigned open_flag argument of
i_op->atomic_open()), build_open_flags() translates OPENAT2_REGULAR
into a kernel-internal lower-32-bit carrier __O_REGULAR (bit 4, unused
as an O_* on every architecture) before the assignment to op->open_flag.
__O_REGULAR then rides through the existing channels exactly like
__FMODE_EXEC. do_dentry_open() strips it so it cannot leak back to
userspace via fcntl(F_GETFL).
Four BUILD_BUG_ON_MSG() invariants in build_open_flags() prevent any
future bit collision or accidental low-32 redefinition:
- VALID_OPEN_FLAGS fits in 32 bits.
- OPENAT2_REGULAR lives in the upper 32 bits.
- OPENAT2_REGULAR does not alias any open()/openat() flag.
- __O_REGULAR does not alias any user-visible flag.
[1]: https://uapi-group.org/kernel-features/#ability-to-only-open-regular-files
Christian Brauner <brauner@kernel.org> says:
Move OPENAT2_REGULAR to the upper 32 bits of open_how::flags with a
kernel-internal __O_REGULAR carrier so that open(2)/openat(2) cannot
encode the flag; add BUILD_BUG_ON_MSG() invariants and register
__O_REGULAR in the fcntl_init() allocation-uniqueness BUILD_BUG_ON()
(bit count 21 -> 22).
Signed-off-by: Dorjoy Chowdhury <dorjoychy111@gmail.com>
Link: https://patch.msgid.link/20260328172314.45807-2-dorjoychy111@gmail.com
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Aleksa Sarai <aleksa@amutable.com>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-05-16 16:42:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-06-08 11:44:56 -04:00
|
|
|
|
2012-07-31 11:27:36 -07:00
|
|
|
|
2014-09-16 20:35:17 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
ceph: preallocate inode for ops that may create one
When creating a new inode, we need to determine the crypto context
before we can transmit the RPC. The fscrypt API has a routine for getting
a crypto context before a create occurs, but it requires an inode.
Change the ceph code to preallocate an inode in advance of a create of
any sort (open(), mknod(), symlink(), etc). Move the existing code that
generates the ACL and SELinux blobs into this routine since that's
mostly common across all the different codepaths.
In most cases, we just want to allow ceph_fill_trace to use that inode
after the reply comes in, so add a new field to the MDS request for it
(r_new_inode).
The async create codepath is a bit different though. In that case, we
want to hash the inode in advance of the RPC so that it can be used
before the reply comes in. If the call subsequently fails with
-EJUKEBOX, then just put the references and clean up the as_ctx. Note
that with this change, we now need to regenerate the as_ctx when this
occurs, but it's quite rare for it to happen.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-08-26 13:11:00 -04:00
|
|
|
|
2019-05-26 15:35:39 +08:00
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2012-06-22 12:39:14 +04:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
|
|
|
|
|
2020-03-05 20:21:00 +08:00
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
|
|
|
|
|
2021-12-07 08:44:50 -05:00
|
|
|
|
2020-03-05 20:21:00 +08:00
|
|
|
|
|
|
|
|
|
2018-03-13 10:42:44 +08:00
|
|
|
|
|
|
|
|
|
2010-03-01 09:57:54 -08:00
|
|
|
|
|
|
|
|
|
2010-07-27 13:11:08 -07:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-14 22:36:18 +08:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-14 22:36:18 +08:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
2023-06-12 10:50:38 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
2016-11-08 21:54:34 +08:00
|
|
|
|
2022-08-25 09:31:12 -04:00
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
2021-11-23 07:30:38 -05:00
|
|
|
|
2022-08-25 09:31:22 -04:00
|
|
|
|
2022-08-25 09:31:12 -04:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-21 10:15:48 +08:00
|
|
|
|
2024-11-27 15:34:10 +02:00
|
|
|
|
2014-07-21 10:15:48 +08:00
|
|
|
|
2010-11-09 12:24:53 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-02-01 11:19:15 +00:00
|
|
|
|
|
|
|
|
|
2010-02-09 11:14:41 -08:00
|
|
|
|
2013-09-26 14:42:17 +08:00
|
|
|
|
2010-02-09 11:14:41 -08:00
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-08 21:54:34 +08:00
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
2024-11-27 15:34:10 +02:00
|
|
|
|
2020-08-21 21:20:59 -07:00
|
|
|
|
2022-02-26 06:33:03 -05:00
|
|
|
|
2022-08-25 09:31:22 -04:00
|
|
|
|
|
|
|
|
|
2023-11-07 10:44:41 +08:00
|
|
|
|
2022-08-25 09:31:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
2022-08-25 09:31:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-26 06:33:03 -05:00
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-26 14:42:17 +08:00
|
|
|
|
2016-11-08 21:54:34 +08:00
|
|
|
|
2022-08-25 09:31:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
2016-11-08 21:54:34 +08:00
|
|
|
|
2024-12-06 17:32:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:22 -04:00
|
|
|
|
|
|
|
|
|
2020-08-21 21:20:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-08 21:54:34 +08:00
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
2022-08-25 09:31:22 -04:00
|
|
|
|
|
|
|
|
|
2024-12-05 16:49:51 +01:00
|
|
|
|
2022-02-26 06:33:03 -05:00
|
|
|
|
2022-06-30 16:21:50 -04:00
|
|
|
|
|
|
|
|
|
2020-03-19 23:45:01 -04:00
|
|
|
|
2021-03-22 20:28:49 +08:00
|
|
|
|
2020-03-19 23:45:01 -04:00
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:22 -04:00
|
|
|
|
2026-02-10 09:06:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-19 23:45:01 -04:00
|
|
|
|
2022-08-25 09:31:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
2022-02-26 06:33:03 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
2022-02-26 06:33:03 -05:00
|
|
|
|
2024-11-27 15:34:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-11-27 15:34:10 +02:00
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
|
|
|
|
|
2022-02-26 06:33:03 -05:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-11-27 15:34:10 +02:00
|
|
|
|
|
|
|
|
|
2024-02-21 09:16:12 +08:00
|
|
|
|
|
|
|
|
|
2024-11-27 15:34:10 +02:00
|
|
|
|
2020-08-21 21:20:59 -07:00
|
|
|
|
2022-08-25 09:31:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-21 21:20:59 -07:00
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:22 -04:00
|
|
|
|
2020-08-21 21:20:59 -07:00
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:22 -04:00
|
|
|
|
|
|
|
|
|
2020-08-21 21:20:59 -07:00
|
|
|
|
|
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
|
|
|
|
|
2024-12-05 16:49:51 +01:00
|
|
|
|
|
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
2019-07-25 20:16:47 +08:00
|
|
|
|
2018-09-29 16:02:19 +08:00
|
|
|
|
2013-09-26 14:42:17 +08:00
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:22 -04:00
|
|
|
|
2024-02-21 09:16:12 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-30 13:16:40 +08:00
|
|
|
|
2022-08-25 09:31:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-26 14:42:17 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2022-08-25 09:31:12 -04:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-16 11:22:29 +08:00
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-13 22:18:37 +02:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-24 08:44:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-13 09:56:06 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-18 09:03:29 +08:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-21 09:22:35 -06:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-28 16:07:24 +02:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-26 06:33:03 -05:00
|
|
|
|
2020-09-03 09:01:39 -04:00
|
|
|
|
2021-05-13 09:40:53 +08:00
|
|
|
|
2022-02-26 06:33:03 -05:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
2015-12-24 08:44:20 +08:00
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:
Single allocations: kmalloc(sizeof(TYPE), ...)
are replaced with: kmalloc_obj(TYPE, ...)
Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with: kmalloc_objs(TYPE, COUNT, ...)
Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)
(where TYPE may also be *VAR)
The resulting allocations no longer return "void *", instead returning
"TYPE *".
Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-20 23:49:23 -08:00
|
|
|
|
2015-12-24 08:44:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 10:50:38 +08:00
|
|
|
|
2015-12-24 08:44:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-26 06:33:03 -05:00
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
2021-05-13 09:40:53 +08:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
2021-05-13 09:40:53 +08:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-15 20:25:47 -04:00
|
|
|
|
2021-05-13 09:40:53 +08:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-22 20:28:51 +08:00
|
|
|
|
|
|
|
|
|
2026-02-10 09:06:26 +00:00
|
|
|
|
2021-03-22 20:28:51 +08:00
|
|
|
|
2021-05-13 09:40:53 +08:00
|
|
|
|
2026-02-10 09:06:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-22 20:28:51 +08:00
|
|
|
|
2021-05-13 09:40:53 +08:00
|
|
|
|
2026-02-10 09:06:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-22 20:28:51 +08:00
|
|
|
|
|
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-24 08:44:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-11 16:15:38 +02:00
|
|
|
|
2015-12-24 08:44:20 +08:00
|
|
|
|
2016-01-26 12:24:44 +03:00
|
|
|
|
|
|
|
|
|
2015-12-24 08:44:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-16 17:27:05 +08:00
|
|
|
|
2016-04-28 16:07:23 +02:00
|
|
|
|
2016-04-29 19:54:20 +02:00
|
|
|
|
2015-12-24 08:44:20 +08:00
|
|
|
|
2018-10-15 16:11:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-27 14:15:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-24 08:44:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-30 16:21:50 -04:00
|
|
|
|
2015-12-24 08:44:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-28 16:07:24 +02:00
|
|
|
|
2015-12-24 08:44:20 +08:00
|
|
|
|
|
|
|
|
|
2016-01-26 23:05:37 +08:00
|
|
|
|
2015-12-24 08:44:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
2013-01-23 17:07:38 -05:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2023-06-12 10:50:38 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2020-03-19 23:45:01 -04:00
|
|
|
|
2013-03-14 14:09:05 -05:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
ceph: add buffered/direct exclusionary locking for reads and writes
xfstest generic/451 intermittently fails. The test does O_DIRECT writes
to a file, and then reads back the result using buffered I/O, while
running a separate set of tasks that are also doing buffered reads.
The client will invalidate the cache prior to a direct write, but it's
easy for one of the other readers' replies to race in and reinstantiate
the invalidated range with stale data.
To fix this, we must to serialize direct I/O writes and buffered reads.
We could just sprinkle in some shared locks on the i_rwsem for reads,
and increase the exclusive footprint on the write side, but that would
cause O_DIRECT writes to end up serialized vs. other direct requests.
Instead, borrow the scheme used by nfs.ko. Buffered writes take the
i_rwsem exclusively, but buffered reads take a shared lock, allowing
them to run in parallel.
O_DIRECT requests also take a shared lock, but we need for them to not
run in parallel with buffered reads. A flag on the ceph_inode_info is
used to indicate whether it's in direct or buffered I/O mode. When a
conflicting request is submitted, it will block until the inode can be
flipped to the necessary mode.
Link: https://tracker.ceph.com/issues/40985
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2019-08-02 13:15:39 -04:00
|
|
|
|
2018-07-13 22:18:37 +02:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-22 14:59:25 -04:00
|
|
|
|
2022-02-26 06:33:03 -05:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
2021-12-07 08:44:50 -05: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
|
|
|
|
2019-02-01 11:19:15 +00:00
|
|
|
|
2016-09-01 22:26:23 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2010-02-09 11:14:41 -08:00
|
|
|
|
2017-08-16 17:27:05 +08:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
2022-02-26 06:33:03 -05:00
|
|
|
|
|
|
|
|
|
2023-11-07 10:44:41 +08:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
2018-05-03 16:10:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
2017-07-21 17:20:10 +08:00
|
|
|
|
2022-02-26 06:33:03 -05:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-03 22:44:19 -04:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
|
|
|
|
|
2024-12-06 17:32:59 +01:00
|
|
|
|
2024-12-07 17:33:25 +01:00
|
|
|
|
2024-12-06 17:32:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
2014-04-03 22:58:25 -04:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
2014-04-03 22:58:25 -04:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2024-12-06 17:32:59 +01:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-16 11:22:29 +08:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
2015-12-24 08:44:20 +08:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-01 18:16:34 +01:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
2016-05-26 00:29:52 +02:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-08 12:50:09 +02:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-30 16:21:50 -04:00
|
|
|
|
|
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
2026-02-10 09:06:26 +00:00
|
|
|
|
2021-03-22 20:28:49 +08:00
|
|
|
|
2021-05-13 09:40:53 +08:00
|
|
|
|
2026-02-10 09:06:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-22 20:28:49 +08:00
|
|
|
|
2021-05-13 09:40:53 +08:00
|
|
|
|
2026-02-10 09:06:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-19 23:45:01 -04:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
2022-02-26 06:33:03 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
2022-02-26 06:33:03 -05:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
2022-09-15 20:25:47 -04:00
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-04 16:57:31 +02:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
2014-04-03 22:58:25 -04:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-03 22:58:25 -04:00
|
|
|
|
2022-10-18 09:03:29 +08:00
|
|
|
|
2014-04-03 22:58:25 -04:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
2016-06-14 11:13:59 +08:00
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-14 11:13:59 +08:00
|
|
|
|
2019-11-13 09:56:06 -05:00
|
|
|
|
2016-06-14 11:13:59 +08:00
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
2019-07-08 12:50:09 +02:00
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
2022-06-30 16:21:50 -04:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
2016-04-28 16:07:24 +02:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-28 14:33:46 +08:00
|
|
|
|
2015-04-30 14:40:54 +08:00
|
|
|
|
|
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 10:50:38 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2022-08-25 09:31:21 -04:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-22 12:03:32 +08:00
|
|
|
|
2018-07-13 22:18:37 +02:00
|
|
|
|
2014-04-03 23:09:01 -04:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
2019-02-01 11:19:15 +00:00
|
|
|
|
|
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-07 08:44:50 -05:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
2014-04-03 23:09:01 -04:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
2022-08-25 09:31:21 -04:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
2022-08-25 09:31:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-13 17:27:05 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-10 09:06:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:20 -04:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
2022-08-25 09:31:20 -04:00
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:21 -04:00
|
|
|
|
2022-08-25 09:31:20 -04:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:21 -04:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2022-08-25 09:31:21 -04:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:21 -04:00
|
|
|
|
|
|
|
|
|
2025-07-09 23:07:53 -07:00
|
|
|
|
2022-08-25 09:31:21 -04:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2022-08-25 09:31:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2022-08-25 09:31:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
2016-05-26 00:29:52 +02:00
|
|
|
|
2022-08-25 09:31:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2021-03-22 20:28:49 +08:00
|
|
|
|
2021-05-13 09:40:53 +08:00
|
|
|
|
2026-02-10 09:06:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
2017-04-04 08:39:46 -04:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2022-08-25 09:31:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-04 08:39:46 -04:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
2017-04-04 08:39:46 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:27 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:27 -04:00
|
|
|
|
|
|
|
|
|
2017-04-04 08:39:46 -04:00
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2017-04-04 08:39:46 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-18 09:03:29 +08:00
|
|
|
|
2017-04-04 08:39:46 -04:00
|
|
|
|
|
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2013-09-12 13:54:26 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-02 20:28:01 -04:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
2010-05-27 10:40:43 -07:00
|
|
|
|
2015-02-11 19:56:46 +01:00
|
|
|
|
2013-01-23 17:07:38 -05:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2020-07-06 08:51:35 -04:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2021-11-30 14:12:13 -05:00
|
|
|
|
2014-11-14 22:36:18 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2010-02-09 14:04:02 -08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2013-09-26 14:42:17 +08:00
|
|
|
|
2021-08-31 13:39:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-12-06 17:50:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-13 09:10:27 -05:00
|
|
|
|
2021-11-30 14:12:13 -05:00
|
|
|
|
|
|
|
|
|
2010-05-27 10:40:43 -07:00
|
|
|
|
2021-11-30 14:12:13 -05:00
|
|
|
|
|
|
|
|
|
2021-04-05 12:19:35 -04:00
|
|
|
|
2019-11-13 09:10:27 -05:00
|
|
|
|
2021-11-30 14:12:13 -05:00
|
|
|
|
2019-11-13 09:10:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-26 14:42:17 +08:00
|
|
|
|
2019-11-13 09:10:27 -05:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2010-05-27 10:40:43 -07:00
|
|
|
|
2015-04-09 13:52:01 -04:00
|
|
|
|
2013-09-26 14:42:17 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-26 14:42:17 +08:00
|
|
|
|
2022-06-07 10:13:53 +08:00
|
|
|
|
2022-08-25 09:31:19 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-14 22:36:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-26 14:42:17 +08:00
|
|
|
|
2017-12-15 11:15:36 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-12-15 11:15:36 +08:00
|
|
|
|
2014-04-02 20:28:01 -04:00
|
|
|
|
2017-12-15 11:15:36 +08:00
|
|
|
|
2013-09-26 14:42:17 +08:00
|
|
|
|
2019-11-13 09:10:27 -05:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2019-11-13 09:10:27 -05:00
|
|
|
|
2020-07-06 08:51:35 -04:00
|
|
|
|
2019-11-13 09:10:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
2014-11-14 22:36:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-22 09:22:43 +08:00
|
|
|
|
2014-11-14 22:36:18 +08:00
|
|
|
|
2015-06-13 17:27:05 +08:00
|
|
|
|
2014-11-14 22:36:18 +08:00
|
|
|
|
|
|
|
|
|
2024-02-22 09:22:43 +08:00
|
|
|
|
|
|
|
|
|
2014-11-14 22:36:18 +08:00
|
|
|
|
2010-02-09 14:04:02 -08:00
|
|
|
|
2024-02-22 09:22:43 +08:00
|
|
|
|
2014-11-14 22:36:18 +08:00
|
|
|
|
2016-10-10 15:38:18 +03:00
|
|
|
|
|
|
|
|
|
2014-11-14 22:36:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-10 11:43:12 +08: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
|
|
|
|
2014-11-14 22:36:18 +08: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
|
|
|
|
2014-11-14 22:36:18 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-10 11:43:12 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-14 22:36:18 +08:00
|
|
|
|
|
|
|
|
|
2015-01-10 11:43:12 +08:00
|
|
|
|
2014-11-14 22:36:18 +08:00
|
|
|
|
2010-02-09 14:04:02 -08:00
|
|
|
|
|
|
|
|
|
2014-11-14 22:36:18 +08:00
|
|
|
|
2015-01-10 11:43:12 +08:00
|
|
|
|
2024-02-22 09:22:43 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2013-09-26 14:42:17 +08:00
|
|
|
|
2010-02-09 14:04:02 -08:00
|
|
|
|
|
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
2010-02-09 14:04:02 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-26 14:42:17 +08:00
|
|
|
|
2010-02-09 14:04:02 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-22 14:50:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-12-06 17:50:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-22 14:50:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-07-06 13:11:27 +00:00
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2014-04-03 23:09:01 -04:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
2010-05-26 14:31:27 -07:00
|
|
|
|
2013-01-23 17:07:38 -05:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2023-06-12 10:50:38 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2020-03-09 12:03:14 +01:00
|
|
|
|
2015-06-10 17:26:13 +08:00
|
|
|
|
2015-04-09 12:55:47 -04:00
|
|
|
|
2021-11-30 14:12:13 -05:00
|
|
|
|
2020-02-03 21:28:25 -05:00
|
|
|
|
2020-03-09 12:03:14 +01:00
|
|
|
|
|
|
|
|
|
2015-04-09 12:55:47 -04:00
|
|
|
|
2018-07-19 22:15:26 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2021-08-31 13:39:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-10 17:26:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-03 21:28:25 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-14 10:50:50 +08:00
|
|
|
|
2024-12-06 17:50:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-12 16:11:13 +08:00
|
|
|
|
2015-09-07 11:35:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-09 12:55:47 -04:00
|
|
|
|
|
|
|
|
|
2013-04-12 16:11:13 +08:00
|
|
|
|
|
|
|
|
|
2015-04-09 12:55:47 -04:00
|
|
|
|
2018-07-19 22:15:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-09 12:55:47 -04:00
|
|
|
|
2018-01-05 10:47:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-09 12:03:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-12 16:11:13 +08:00
|
|
|
|
2013-03-01 10:55:39 +08:00
|
|
|
|
|
|
|
|
|
2013-04-12 16:11:13 +08:00
|
|
|
|
2021-08-11 06:40:42 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-30 14:12:13 -05:00
|
|
|
|
|
|
|
|
|
2013-05-01 21:15:58 -07:00
|
|
|
|
2021-11-30 14:12:13 -05:00
|
|
|
|
2013-04-12 16:11:13 +08:00
|
|
|
|
2021-04-05 12:19:35 -04:00
|
|
|
|
2013-04-12 16:11:13 +08:00
|
|
|
|
2013-04-12 16:11:10 +08:00
|
|
|
|
2013-05-01 21:15:58 -07:00
|
|
|
|
ceph: revalidate ki_pos for O_APPEND writes after cap acquisition
For O_APPEND writes, ki_pos is set to the current EOF via
generic_write_checks() after fetching i_size from the MDS. However,
ceph_get_caps() may need to wait for Fwx exclusive caps if the write
extends the file (endoff > i_max_size). While waiting for Fwx, the
previous Fwx holder (another client) may have already extended the
file. When the MDS grants us Fwx, the cap grant message updates the
local i_size, but ki_pos remains at the old EOF, causing the append
write to land at a stale offset and overwrite data from the other
client.
Fix by re-reading i_size_read(inode) after ceph_get_caps() returns.
At this point we hold Fwx exclusive caps, no other client can modify
the file, and i_size reflects the true EOF from the MDS cap grant.
No extra MDS round-trip is needed. Only adjust ki_pos when the EOF
has actually changed.
After adjusting ki_pos forward, the write range [pos, pos+count) may
now exceed the i_max_size that was validated by ceph_get_caps() for
the old range. Re-check against i_max_size and truncate the write
if necessary to stay within the MDS-granted limit.
Link: https://tracker.ceph.com/issues/7333
Fixes: 8e4473bb50a1 ("ceph: do not execute direct write in parallel if O_APPEND is specified")
Signed-off-by: Xiubo Li <xiubo.li@clyso.com>
Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2026-07-21 13:06:53 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-11 06:40:42 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2013-05-01 21:15:58 -07:00
|
|
|
|
|
|
|
|
|
2017-04-04 08:39:46 -04:00
|
|
|
|
2026-05-07 08:05:30 +00:00
|
|
|
|
2015-04-30 14:40:54 +08:00
|
|
|
|
2014-04-03 23:09:01 -04:00
|
|
|
|
2015-04-30 14:40:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-03 23:09:01 -04:00
|
|
|
|
|
|
|
|
|
2022-08-25 09:31:19 -04:00
|
|
|
|
2015-12-23 21:23:38 +08:00
|
|
|
|
|
|
|
|
|
2020-02-03 21:28:25 -05:00
|
|
|
|
2015-04-30 14:40:54 +08:00
|
|
|
|
2020-02-03 21:28:25 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ceph: add buffered/direct exclusionary locking for reads and writes
xfstest generic/451 intermittently fails. The test does O_DIRECT writes
to a file, and then reads back the result using buffered I/O, while
running a separate set of tasks that are also doing buffered reads.
The client will invalidate the cache prior to a direct write, but it's
easy for one of the other readers' replies to race in and reinstantiate
the invalidated range with stale data.
To fix this, we must to serialize direct I/O writes and buffered reads.
We could just sprinkle in some shared locks on the i_rwsem for reads,
and increase the exclusive footprint on the write side, but that would
cause O_DIRECT writes to end up serialized vs. other direct requests.
Instead, borrow the scheme used by nfs.ko. Buffered writes take the
i_rwsem exclusively, but buffered reads take a shared lock, allowing
them to run in parallel.
O_DIRECT requests also take a shared lock, but we need for them to not
run in parallel with buffered reads. A flag on the ceph_inode_info is
used to indicate whether it's in direct or buffered I/O mode. When a
conflicting request is submitted, it will block until the inode can be
flipped to the necessary mode.
Link: https://tracker.ceph.com/issues/40985
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2019-08-02 13:15:39 -04:00
|
|
|
|
2014-04-03 23:09:01 -04:00
|
|
|
|
|
|
|
|
|
2015-04-30 14:40:54 +08:00
|
|
|
|
2013-05-01 21:15:58 -07:00
|
|
|
|
2013-08-12 21:42:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-19 23:19:49 -05:00
|
|
|
|
ceph: add buffered/direct exclusionary locking for reads and writes
xfstest generic/451 intermittently fails. The test does O_DIRECT writes
to a file, and then reads back the result using buffered I/O, while
running a separate set of tasks that are also doing buffered reads.
The client will invalidate the cache prior to a direct write, but it's
easy for one of the other readers' replies to race in and reinstantiate
the invalidated range with stale data.
To fix this, we must to serialize direct I/O writes and buffered reads.
We could just sprinkle in some shared locks on the i_rwsem for reads,
and increase the exclusive footprint on the write side, but that would
cause O_DIRECT writes to end up serialized vs. other direct requests.
Instead, borrow the scheme used by nfs.ko. Buffered writes take the
i_rwsem exclusively, but buffered reads take a shared lock, allowing
them to run in parallel.
O_DIRECT requests also take a shared lock, but we need for them to not
run in parallel with buffered reads. A flag on the ceph_inode_info is
used to indicate whether it's in direct or buffered I/O mode. When a
conflicting request is submitted, it will block until the inode can be
flipped to the necessary mode.
Link: https://tracker.ceph.com/issues/40985
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2019-08-02 13:15:39 -04:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2011-07-26 11:27:34 -07:00
|
|
|
|
2013-04-12 16:11:13 +08:00
|
|
|
|
2011-05-04 11:33:47 -07:00
|
|
|
|
2018-01-05 10:47:22 +00:00
|
|
|
|
2011-11-30 09:47:09 -08:00
|
|
|
|
2015-06-10 17:26:13 +08:00
|
|
|
|
|
|
|
|
|
2011-11-30 09:47:09 -08:00
|
|
|
|
2011-05-04 11:33:47 -07:00
|
|
|
|
|
|
|
|
|
2018-01-05 10:47:22 +00:00
|
|
|
|
2022-10-18 09:03:29 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2013-05-01 21:15:58 -07:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2013-05-01 21:15:58 -07:00
|
|
|
|
2017-08-14 10:50:50 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2017-08-14 10:50:50 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-07 08:52:02 -07:00
|
|
|
|
2026-07-06 13:11:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-07 08:52:02 -07:00
|
|
|
|
|
|
|
|
|
2013-03-01 10:55:39 +08:00
|
|
|
|
2013-04-12 16:11:13 +08:00
|
|
|
|
2013-08-09 09:57:58 -07:00
|
|
|
|
2021-08-11 06:40:42 -04:00
|
|
|
|
|
|
|
|
|
2013-08-09 09:57:58 -07:00
|
|
|
|
2020-02-03 21:28:25 -05:00
|
|
|
|
ceph: add buffered/direct exclusionary locking for reads and writes
xfstest generic/451 intermittently fails. The test does O_DIRECT writes
to a file, and then reads back the result using buffered I/O, while
running a separate set of tasks that are also doing buffered reads.
The client will invalidate the cache prior to a direct write, but it's
easy for one of the other readers' replies to race in and reinstantiate
the invalidated range with stale data.
To fix this, we must to serialize direct I/O writes and buffered reads.
We could just sprinkle in some shared locks on the i_rwsem for reads,
and increase the exclusive footprint on the write side, but that would
cause O_DIRECT writes to end up serialized vs. other direct requests.
Instead, borrow the scheme used by nfs.ko. Buffered writes take the
i_rwsem exclusively, but buffered reads take a shared lock, allowing
them to run in parallel.
O_DIRECT requests also take a shared lock, but we need for them to not
run in parallel with buffered reads. A flag on the ceph_inode_info is
used to indicate whether it's in direct or buffered I/O mode. When a
conflicting request is submitted, it will block until the inode can be
flipped to the necessary mode.
Link: https://tracker.ceph.com/issues/40985
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2019-08-02 13:15:39 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-09 09:57:58 -07:00
|
|
|
|
2015-06-10 17:26:13 +08:00
|
|
|
|
2013-04-12 16:11:13 +08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-17 15:59:39 -08:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2012-12-17 15:59:39 -08:00
|
|
|
|
2022-06-07 11:05:49 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-16 21:46:17 +08:00
|
|
|
|
2016-07-21 13:43:09 -04:00
|
|
|
|
2022-06-07 11:05:49 -04:00
|
|
|
|
2011-07-18 13:21:38 -04:00
|
|
|
|
2022-06-07 11:05:49 -04:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
2025-06-12 15:34:40 +01:00
|
|
|
|
|
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
2025-06-12 15:34:40 +01:00
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
2025-06-12 15:34:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-15 11:51:44 +08: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
|
|
|
|
2013-08-15 11:51:44 +08: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
|
|
|
|
|
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 10:50:38 +08:00
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
2025-09-25 18:42:05 +08:00
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-01 09:36:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-09-25 18:42:05 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-13 14:40:37 +08:00
|
|
|
|
2017-02-11 18:48:41 +01:00
|
|
|
|
2025-09-25 18:42:05 +08:00
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-04 14:52:09 -04:00
|
|
|
|
2022-06-30 16:21:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-09-25 18:42:05 +08:00
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-03 21:24:49 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-04-22 12:32:04 +03:00
|
|
|
|
2013-08-27 12:15:16 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-11 13:49:11 +08:00
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
2015-06-10 17:26:13 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2023-02-13 13:56:20 +08:00
|
|
|
|
2018-10-09 18:54:28 +01:00
|
|
|
|
2014-06-26 15:25:17 +08:00
|
|
|
|
|
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-07-01 14:40:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-10 17:26:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-01-22 15:40:57 -05:00
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-09 18:54:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-04-05 12:19:35 -04:00
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-13 13:56:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-04-22 16:38:26 +02:00
|
|
|
|
2021-12-07 08:44:50 -05:00
|
|
|
|
2018-10-09 18:54:28 +01:00
|
|
|
|
|
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-10 17:26:13 +08:00
|
|
|
|
|
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-04-22 16:38:26 +02:00
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
2023-02-13 13:56:20 +08:00
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
|
|
|
|
|
2016-01-22 15:40:57 -05:00
|
|
|
|
2015-06-10 17:26:13 +08:00
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-25 20:16:43 +08:00
|
|
|
|
|
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-25 20:16:43 +08:00
|
|
|
|
2021-04-05 12:19:35 -04:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-25 20:16:43 +08:00
|
|
|
|
|
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-25 20:16:43 +08:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-25 20:16:43 +08:00
|
|
|
|
2021-04-05 12:19:35 -04:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-25 20:16:43 +08:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-04 12:31:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-24 13:44:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-04 12:31:46 +00:00
|
|
|
|
|
|
|
|
|
2025-06-06 12:05:45 -07:00
|
|
|
|
2020-02-24 13:44:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2020-02-24 13:44:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-04 12:31:46 +00:00
|
|
|
|
2020-02-24 13:44:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-04 12:31:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-30 16:21:50 -04:00
|
|
|
|
2021-11-04 12:31:46 +00:00
|
|
|
|
2021-11-04 12:31:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-04 12:31:46 +00:00
|
|
|
|
|
|
|
|
|
2020-02-24 13:44:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2020-02-24 13:44:32 +00:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2025-06-06 12:05:45 -07:00
|
|
|
|
2020-02-24 13:44:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-05 08:04:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 10:50:38 +08:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2020-02-24 13:44:32 +00:00
|
|
|
|
|
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
2020-02-24 13:44:32 +00:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
2019-09-09 16:48:54 +01:00
|
|
|
|
2023-06-12 10:50:38 +08:00
|
|
|
|
2019-09-09 16:48:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-09-09 16:48:54 +01:00
|
|
|
|
2018-10-15 16:46:00 +01:00
|
|
|
|
|
|
|
|
|
2020-01-08 10:03:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-31 11:49:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
2019-10-31 11:49:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
2019-10-31 11:49:39 +00:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
2021-07-01 14:40:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-23 16:53:14 +00:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
2018-10-23 16:53:14 +00:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
2018-10-23 16:53:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2018-10-23 16:53:14 +00:00
|
|
|
|
|
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-25 20:16:43 +08:00
|
|
|
|
|
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-07 08:44:50 -05:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
2020-02-24 13:44:32 +00:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
|
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2020-02-24 13:44:32 +00:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-30 16:16:22 +02:00
|
|
|
|
|
|
|
|
|
2020-02-24 13:44:32 +00:00
|
|
|
|
2023-10-07 11:52:39 +03:00
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-25 20:16:43 +08:00
|
|
|
|
|
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-24 13:44:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2020-02-24 13:44:32 +00:00
|
|
|
|
|
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
2019-06-06 08:57:27 -04:00
|
|
|
|
|
|
|
|
|
2020-02-24 13:44:32 +00:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
2020-03-05 20:21:01 +08:00
|
|
|
|
|
|
|
|
|
2022-10-18 09:03:29 +08:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-24 13:44:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2023-11-30 16:16:22 +02:00
|
|
|
|
|
|
|
|
|
2020-02-24 13:44:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-12 09:04:07 +08:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-05 08:04:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-06-05 08:04:50 -07:00
|
|
|
|
2023-12-12 11:44:37 +02:00
|
|
|
|
|
|
|
|
|
2019-06-05 08:04:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-02 20:28:01 -04:00
|
|
|
|
2014-04-03 23:09:01 -04:00
|
|
|
|
fs: replace mmap hook with .mmap_prepare for simple mappings
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().
This callback is invoked in the mmap() logic far earlier, so error handling
can be performed more safely without complicated and bug-prone state
unwinding required should an error arise.
This hook also avoids passing a pointer to a not-yet-correctly-established
VMA avoiding any issues with referencing this data structure.
It rather provides a pointer to the new struct vm_area_desc descriptor type
which contains all required state and allows easy setting of required
parameters without any consideration needing to be paid to locking or
reference counts.
Note that nested filesystems like overlayfs are compatible with an
.mmap_prepare() callback since commit bb666b7c2707 ("mm: add mmap_prepare()
compatibility layer for nested file systems").
In this patch we apply this change to file systems with relatively simple
mmap() hook logic - exfat, ceph, f2fs, bcachefs, zonefs, btrfs, ocfs2,
orangefs, nilfs2, romfs, ramfs and aio.
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Link: https://lore.kernel.org/f528ac4f35b9378931bd800920fee53fc0c5c74d.1750099179.git.lorenzo.stoakes@oracle.com
Acked-by: Damien Le Moal <dlemoal@kernel.org>
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:29 +01:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2010-08-02 15:34:23 -07:00
|
|
|
|
|
|
|
|
|
2023-05-22 14:50:03 +01:00
|
|
|
|
2014-04-05 04:40:12 -04:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|
2018-09-11 20:47:23 +02:00
|
|
|
|
2013-08-15 11:51:44 +08:00
|
|
|
|
2018-10-15 16:45:59 +01:00
|
|
|
|
2009-10-06 11:31:08 -07:00
|
|
|
|