2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-02-12 00:53:46 -08:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-12-08 02:36:31 -08: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
|
|
|
|
2010-10-05 18:53:45 +02:00
|
|
|
|
2008-07-23 21:30:07 -07:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-12 14:02:04 -07:00
|
|
|
|
2016-01-22 15:40:57 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-01-22 15:40:57 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-23 21:18:20 -05:00
|
|
|
|
|
|
|
|
|
2014-06-27 01:11:59 +05:30
|
|
|
|
2011-05-23 21:18:20 -05:00
|
|
|
|
|
|
|
|
|
2011-05-24 02:16:51 -05:00
|
|
|
|
2011-05-23 21:18:20 -05:00
|
|
|
|
2011-05-24 02:16:51 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-23 21:18:20 -05:00
|
|
|
|
|
|
|
|
|
2011-05-24 02:16:51 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-23 21:18:20 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-24 02:16:51 -05:00
|
|
|
|
|
|
|
|
|
2011-05-23 21:18:20 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-24 02:16:51 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-23 21:18:20 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-24 02:16:51 -05:00
|
|
|
|
2011-05-23 21:18:20 -05:00
|
|
|
|
2011-05-24 02:16:51 -05:00
|
|
|
|
2011-05-23 21:18:20 -05:00
|
|
|
|
2011-05-24 02:16:51 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-23 21:18:20 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-24 02:16:51 -05:00
|
|
|
|
2011-05-23 21:18:20 -05:00
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2011-05-24 02:16:51 -05:00
|
|
|
|
2011-05-23 21:18:20 -05:00
|
|
|
|
|
|
|
|
|
2011-05-24 02:16:51 -05:00
|
|
|
|
|
|
|
|
|
2011-05-23 21:18:20 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-05-22 15:09:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-09-20 09:14:34 -04:00
|
|
|
|
2012-05-22 15:09:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-11-21 17:31:02 -06:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2011-11-21 17:31:02 -06:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2011-07-26 03:30:54 -04:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-11-21 17:31:02 -06:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2007-10-16 01:28:09 -07:00
|
|
|
|
2008-01-08 15:33:02 -08:00
|
|
|
|
2008-04-29 00:59:48 -07:00
|
|
|
|
2011-11-21 17:31:02 -06:00
|
|
|
|
2008-01-08 15:33:02 -08:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2011-11-21 17:31:02 -06:00
|
|
|
|
2012-05-22 15:09:50 -05:00
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2012-05-22 15:09:50 -05:00
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2011-11-21 17:31:02 -06:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-20 23:50:59 -07:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2007-10-16 01:28:10 -07:00
|
|
|
|
2011-11-21 17:31:02 -06:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2011-11-21 17:31:02 -06:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2007-02-12 00:53:49 -08:00
|
|
|
|
2007-10-16 01:28:10 -07:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2011-11-21 17:31:02 -06:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2007-10-16 01:28:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2011-11-21 17:31:02 -06:00
|
|
|
|
2010-11-03 11:11:28 +01:00
|
|
|
|
|
|
|
|
|
eCryptfs: Add reference counting to lower files
For any given lower inode, eCryptfs keeps only one lower file open and
multiplexes all eCryptfs file operations through that lower file. The
lower file was considered "persistent" and stayed open from the first
lookup through the lifetime of the inode.
This patch keeps the notion of a single, per-inode lower file, but adds
reference counting around the lower file so that it is closed when not
currently in use. If the reference count is at 0 when an operation (such
as open, create, etc.) needs to use the lower file, a new lower file is
opened. Since the file is no longer persistent, all references to the
term persistent file are changed to lower file.
Locking is added around the sections of code that opens the lower file
and assign the pointer in the inode info, as well as the code the fputs
the lower file when all eCryptfs users are done with it.
This patch is needed to fix issues, when mounted on top of the NFSv3
client, where the lower file is left silly renamed until the eCryptfs
inode is destroyed.
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
2011-04-14 15:35:11 -05:00
|
|
|
|
2013-12-10 15:26:48 +00:00
|
|
|
|
|
|
|
|
|
2010-11-03 11:11:28 +01:00
|
|
|
|
2008-07-23 21:30:08 -07:00
|
|
|
|
2011-11-21 17:31:02 -06:00
|
|
|
|
eCryptfs: Add reference counting to lower files
For any given lower inode, eCryptfs keeps only one lower file open and
multiplexes all eCryptfs file operations through that lower file. The
lower file was considered "persistent" and stayed open from the first
lookup through the lifetime of the inode.
This patch keeps the notion of a single, per-inode lower file, but adds
reference counting around the lower file so that it is closed when not
currently in use. If the reference count is at 0 when an operation (such
as open, create, etc.) needs to use the lower file, a new lower file is
opened. Since the file is no longer persistent, all references to the
term persistent file are changed to lower file.
Locking is added around the sections of code that opens the lower file
and assign the pointer in the inode info, as well as the code the fputs
the lower file when all eCryptfs users are done with it.
This patch is needed to fix issues, when mounted on top of the NFSv3
client, where the lower file is left silly renamed until the eCryptfs
inode is destroyed.
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
2011-04-14 15:35:11 -05:00
|
|
|
|
2007-10-16 01:28:10 -07:00
|
|
|
|
2011-11-21 17:31:02 -06:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-10 18:05:36 -04:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2011-11-21 17:31:02 -06:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2011-11-21 17:31:02 -06:00
|
|
|
|
|
|
|
|
|
2015-08-12 15:59:44 +05:30
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2011-11-21 17:31:02 -06:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-11-21 17:31:02 -06:00
|
|
|
|
|
|
|
|
|
2012-05-22 15:09:50 -05:00
|
|
|
|
|
|
|
|
|
2015-12-05 18:23:48 -05:00
|
|
|
|
2011-11-21 17:31:02 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-19 09:18:15 +04:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-24 04:56:23 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-10 15:26:48 +00:00
|
|
|
|
|
|
|
|
|
2011-05-24 04:56:23 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2011-05-24 02:16:51 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2016-03-28 00:30:35 -04:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2011-05-24 04:56:23 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2011-05-24 04:56:23 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-06 14:42:00 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-24 04:56:23 -05:00
|
|
|
|
2016-03-28 00:30:35 -04:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2012-07-20 12:09:19 +04:00
|
|
|
|
|
|
|
|
|
2016-03-28 00:30:35 -04:00
|
|
|
|
|
|
|
|
|
2013-07-05 18:59:33 +04:00
|
|
|
|
2012-07-20 12:09:19 +04:00
|
|
|
|
|
|
|
|
|
2013-09-15 20:50:13 -04:00
|
|
|
|
|
|
|
|
|
2011-05-24 04:56:23 -05:00
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2011-05-24 04:56:23 -05:00
|
|
|
|
2016-03-28 00:30:35 -04:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2016-03-28 00:30:35 -04:00
|
|
|
|
2011-05-24 02:16:51 -05:00
|
|
|
|
2011-05-24 04:56:23 -05:00
|
|
|
|
|
|
|
|
|
2016-03-28 00:30:35 -04:00
|
|
|
|
2008-07-23 21:30:08 -07:00
|
|
|
|
2011-05-24 04:56:23 -05:00
|
|
|
|
|
|
|
|
|
2007-02-12 00:53:46 -08:00
|
|
|
|
2011-05-24 04:56:23 -05:00
|
|
|
|
2016-03-28 00:30:35 -04:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2011-05-24 04:56:23 -05:00
|
|
|
|
2011-05-24 03:49:02 -05:00
|
|
|
|
|
|
|
|
|
2016-03-28 00:30:35 -04:00
|
|
|
|
2009-01-06 14:42:00 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-12 08:29:38 -04:00
|
|
|
|
2009-01-06 14:42:00 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-10 17:13:09 -04:00
|
|
|
|
2009-01-06 14:42:00 -08:00
|
|
|
|
|
|
|
|
|
2016-03-28 00:43:29 -04:00
|
|
|
|
2009-01-06 14:42:00 -08:00
|
|
|
|
2016-03-28 00:43:29 -04:00
|
|
|
|
|
|
|
|
|
2016-03-28 00:30:35 -04:00
|
|
|
|
2009-01-06 14:42:00 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-28 00:43:29 -04:00
|
|
|
|
2009-03-20 02:23:57 -05:00
|
|
|
|
|
|
|
|
|
2016-03-28 00:43:29 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-06 14:42:00 -08:00
|
|
|
|
2016-03-28 00:43:29 -04:00
|
|
|
|
|
|
|
|
|
2009-01-06 14:42:00 -08:00
|
|
|
|
2011-02-17 18:51:24 -06:00
|
|
|
|
2016-03-28 00:30:35 -04:00
|
|
|
|
|
|
|
|
|
2016-03-28 00:43:29 -04:00
|
|
|
|
2016-03-28 00:30:35 -04:00
|
|
|
|
2016-03-28 00:43:29 -04:00
|
|
|
|
|
|
|
|
|
2009-01-06 14:42:00 -08:00
|
|
|
|
|
|
|
|
|
2016-03-28 00:30:35 -04:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2011-09-20 17:14:31 -04:00
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2011-05-24 02:16:51 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-06 14:42:00 -08:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-06 14:42:00 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2008-06-24 16:50:16 +02:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2011-05-24 02:16:51 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-26 01:41:39 -04:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2011-05-24 02:16:51 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-30 22:07:20 -08:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2006-10-30 22:07:20 -08:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2006-10-30 22:07:20 -08:00
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2006-10-30 22:07:20 -08:00
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-30 22:07:20 -08:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-26 01:52:52 -04:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2011-05-24 02:16:51 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fs: make remaining filesystems use .rename2
This is trivial to do:
- add flags argument to foo_rename()
- check if flags is zero
- assign foo_rename() to .rename2 instead of .rename
This doesn't mean it's impossible to support RENAME_NOREPLACE for these
filesystems, but it is not trivial, like for local filesystems.
RENAME_NOREPLACE must guarantee atomicity (i.e. it shouldn't be possible
for a file to be created on one host while it is overwritten by rename on
another host).
Filesystems converted:
9p, afs, ceph, coda, ecryptfs, kernfs, lustre, ncpfs, nfs, ocfs2, orangefs.
After this, we can get rid of the duplicate interfaces for rename.
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: David Howells <dhowells@redhat.com> [AFS]
Acked-by: Mike Marshall <hubcap@omnibond.com>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: Jan Harkes <jaharkes@cs.cmu.edu>
Cc: Tyler Hicks <tyhicks@canonical.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Mark Fasheh <mfasheh@suse.com>
2016-09-27 11:03:58 +02:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-05 21:17:09 -05:00
|
|
|
|
2012-09-13 12:00:56 -07:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
fs: make remaining filesystems use .rename2
This is trivial to do:
- add flags argument to foo_rename()
- check if flags is zero
- assign foo_rename() to .rename2 instead of .rename
This doesn't mean it's impossible to support RENAME_NOREPLACE for these
filesystems, but it is not trivial, like for local filesystems.
RENAME_NOREPLACE must guarantee atomicity (i.e. it shouldn't be possible
for a file to be created on one host while it is overwritten by rename on
another host).
Filesystems converted:
9p, afs, ceph, coda, ecryptfs, kernfs, lustre, ncpfs, nfs, ocfs2, orangefs.
After this, we can get rid of the duplicate interfaces for rename.
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: David Howells <dhowells@redhat.com> [AFS]
Acked-by: Mike Marshall <hubcap@omnibond.com>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: Jan Harkes <jaharkes@cs.cmu.edu>
Cc: Tyler Hicks <tyhicks@canonical.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Mark Fasheh <mfasheh@suse.com>
2016-09-27 11:03:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2009-12-05 21:17:09 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
|
|
|
|
|
2014-04-01 17:08:42 +02:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2012-09-13 12:00:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2011-04-12 11:23:09 -05:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-11-29 22:51:47 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2010-03-22 00:41:35 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2013-11-29 22:51:47 -05:00
|
|
|
|
2009-01-06 14:42:00 -08:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2012-05-03 09:34:20 -04:00
|
|
|
|
2013-11-29 22:51:47 -05:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2012-05-03 09:34:20 -04:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2010-03-22 00:41:35 -05:00
|
|
|
|
|
|
|
|
|
2013-11-29 22:51:47 -05:00
|
|
|
|
2012-05-03 09:34:20 -04:00
|
|
|
|
2010-03-22 00:41:35 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2013-11-29 22:51:47 -05:00
|
|
|
|
2010-03-22 00:41:35 -05:00
|
|
|
|
|
|
|
|
|
2015-11-17 10:20:54 -05:00
|
|
|
|
2015-12-29 15:58:39 -05:00
|
|
|
|
|
|
|
|
|
2010-03-22 00:41:35 -05:00
|
|
|
|
2013-11-29 22:51:47 -05:00
|
|
|
|
2015-11-17 10:20:54 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-11-29 22:51:47 -05:00
|
|
|
|
2015-05-02 13:32:22 -04:00
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
|
|
|
|
|
2012-05-03 09:34:20 -04:00
|
|
|
|
2015-12-29 15:58:39 -05:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-06 01:38:32 -08:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-11 07:10:38 -06:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
|
|
|
|
|
eCryptfs: Add reference counting to lower files
For any given lower inode, eCryptfs keeps only one lower file open and
multiplexes all eCryptfs file operations through that lower file. The
lower file was considered "persistent" and stayed open from the first
lookup through the lifetime of the inode.
This patch keeps the notion of a single, per-inode lower file, but adds
reference counting around the lower file so that it is closed when not
currently in use. If the reference count is at 0 when an operation (such
as open, create, etc.) needs to use the lower file, a new lower file is
opened. Since the file is no longer persistent, all references to the
term persistent file are changed to lower file.
Locking is added around the sections of code that opens the lower file
and assign the pointer in the inode info, as well as the code the fputs
the lower file when all eCryptfs users are done with it.
This patch is needed to fix issues, when mounted on top of the NFSv3
client, where the lower file is left silly renamed until the eCryptfs
inode is destroyed.
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
2011-04-14 15:35:11 -05:00
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
2011-05-24 03:49:02 -05:00
|
|
|
|
eCryptfs: Add reference counting to lower files
For any given lower inode, eCryptfs keeps only one lower file open and
multiplexes all eCryptfs file operations through that lower file. The
lower file was considered "persistent" and stayed open from the first
lookup through the lifetime of the inode.
This patch keeps the notion of a single, per-inode lower file, but adds
reference counting around the lower file so that it is closed when not
currently in use. If the reference count is at 0 when an operation (such
as open, create, etc.) needs to use the lower file, a new lower file is
opened. Since the file is no longer persistent, all references to the
term persistent file are changed to lower file.
Locking is added around the sections of code that opens the lower file
and assign the pointer in the inode info, as well as the code the fputs
the lower file when all eCryptfs users are done with it.
This patch is needed to fix issues, when mounted on top of the NFSv3
client, where the lower file is left silly renamed until the eCryptfs
inode is destroyed.
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
2011-04-14 15:35:11 -05:00
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
2007-10-16 01:28:10 -07:00
|
|
|
|
|
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
2007-10-16 01:28:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-21 11:09:58 -04:00
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-04-01 15:29:48 +03: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
|
|
|
|
|
|
|
|
|
2007-10-16 01:28:10 -07:00
|
|
|
|
2009-04-13 15:29:27 -05:00
|
|
|
|
2010-06-04 11:30:04 +02:00
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
|
|
|
|
|
2010-05-21 11:09:58 -04:00
|
|
|
|
2009-04-13 15:29:27 -05:00
|
|
|
|
2007-10-16 01:28:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-21 11:09:58 -04:00
|
|
|
|
2007-10-16 01:28:10 -07:00
|
|
|
|
2010-05-21 11:09:58 -04:00
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
2007-10-16 01:28:10 -07:00
|
|
|
|
2007-10-16 01:28:06 -07:00
|
|
|
|
2007-06-27 14:09:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-21 11:09:58 -04:00
|
|
|
|
2007-06-27 14:09:44 -07:00
|
|
|
|
|
|
|
|
|
2010-06-04 11:30:04 +02:00
|
|
|
|
2007-10-16 01:28:08 -07:00
|
|
|
|
2007-02-12 00:53:46 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-21 11:09:58 -04:00
|
|
|
|
2007-02-12 00:53:46 -08:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
eCryptfs: Add reference counting to lower files
For any given lower inode, eCryptfs keeps only one lower file open and
multiplexes all eCryptfs file operations through that lower file. The
lower file was considered "persistent" and stayed open from the first
lookup through the lifetime of the inode.
This patch keeps the notion of a single, per-inode lower file, but adds
reference counting around the lower file so that it is closed when not
currently in use. If the reference count is at 0 when an operation (such
as open, create, etc.) needs to use the lower file, a new lower file is
opened. Since the file is no longer persistent, all references to the
term persistent file are changed to lower file.
Locking is added around the sections of code that opens the lower file
and assign the pointer in the inode info, as well as the code the fputs
the lower file when all eCryptfs users are done with it.
This patch is needed to fix issues, when mounted on top of the NFSv3
client, where the lower file is left silly renamed until the eCryptfs
inode is destroyed.
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
2011-04-14 15:35:11 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
eCryptfs: Check inode changes in setattr
Most filesystems call inode_change_ok() very early in ->setattr(), but
eCryptfs didn't call it at all. It allowed the lower filesystem to make
the call in its ->setattr() function. Then, eCryptfs would copy the
appropriate inode attributes from the lower inode to the eCryptfs inode.
This patch changes that and actually calls inode_change_ok() on the
eCryptfs inode, fairly early in ecryptfs_setattr(). Ideally, the call
would happen earlier in ecryptfs_setattr(), but there are some possible
inode initialization steps that must happen first.
Since the call was already being made on the lower inode, the change in
functionality should be minimal, except for the case of a file extending
truncate call. In that case, inode_newsize_ok() was never being
called on the eCryptfs inode. Rather than inode_newsize_ok() catching
maximum file size errors early on, eCryptfs would encrypt zeroed pages
and write them to the lower filesystem until the lower filesystem's
write path caught the error in generic_write_checks(). This patch
introduces a new function, called ecryptfs_inode_newsize_ok(), which
checks if the new lower file size is within the appropriate limits when
the truncate operation will be growing the lower file.
In summary this change prevents eCryptfs truncate operations (and the
resulting page encryptions), which would exceed the lower filesystem
limits or FSIZE rlimits, from ever starting.
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reviewed-by: Li Wang <liwang@nudt.edu.cn>
Cc: <stable@vger.kernel.org>
2012-01-19 20:33:44 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
eCryptfs: Check inode changes in setattr
Most filesystems call inode_change_ok() very early in ->setattr(), but
eCryptfs didn't call it at all. It allowed the lower filesystem to make
the call in its ->setattr() function. Then, eCryptfs would copy the
appropriate inode attributes from the lower inode to the eCryptfs inode.
This patch changes that and actually calls inode_change_ok() on the
eCryptfs inode, fairly early in ecryptfs_setattr(). Ideally, the call
would happen earlier in ecryptfs_setattr(), but there are some possible
inode initialization steps that must happen first.
Since the call was already being made on the lower inode, the change in
functionality should be minimal, except for the case of a file extending
truncate call. In that case, inode_newsize_ok() was never being
called on the eCryptfs inode. Rather than inode_newsize_ok() catching
maximum file size errors early on, eCryptfs would encrypt zeroed pages
and write them to the lower filesystem until the lower filesystem's
write path caught the error in generic_write_checks(). This patch
introduces a new function, called ecryptfs_inode_newsize_ok(), which
checks if the new lower file size is within the appropriate limits when
the truncate operation will be growing the lower file.
In summary this change prevents eCryptfs truncate operations (and the
resulting page encryptions), which would exceed the lower filesystem
limits or FSIZE rlimits, from ever starting.
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reviewed-by: Li Wang <liwang@nudt.edu.cn>
Cc: <stable@vger.kernel.org>
2012-01-19 20:33:44 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-01-22 15:40:57 -05:00
|
|
|
|
2011-09-20 17:19:26 -04:00
|
|
|
|
2016-01-22 15:40:57 -05:00
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2011-06-20 19:28:19 -04:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2008-07-22 00:07:17 -04:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2016-04-16 15:01:09 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2007-06-27 14:09:44 -07:00
|
|
|
|
|
|
|
|
|
VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry)
Convert the following where appropriate:
(1) S_ISLNK(dentry->d_inode) to d_is_symlink(dentry).
(2) S_ISREG(dentry->d_inode) to d_is_reg(dentry).
(3) S_ISDIR(dentry->d_inode) to d_is_dir(dentry). This is actually more
complicated than it appears as some calls should be converted to
d_can_lookup() instead. The difference is whether the directory in
question is a real dir with a ->lookup op or whether it's a fake dir with
a ->d_automount op.
In some circumstances, we can subsume checks for dentry->d_inode not being
NULL into this, provided we the code isn't in a filesystem that expects
d_inode to be NULL if the dirent really *is* negative (ie. if we're going to
use d_inode() rather than d_backing_inode() to get the inode pointer).
Note that the dentry type field may be set to something other than
DCACHE_MISS_TYPE when d_inode is NULL in the case of unionmount, where the VFS
manages the fall-through from a negative dentry to a lower layer. In such a
case, the dentry type of the negative union dentry is set to the same as the
type of the lower dentry.
However, if you know d_inode is not NULL at the call site, then you can use
the d_is_xxx() functions even in a filesystem.
There is one further complication: a 0,0 chardev dentry may be labelled
DCACHE_WHITEOUT_TYPE rather than DCACHE_SPECIAL_TYPE. Strictly, this was
intended for special directory entry types that don't have attached inodes.
The following perl+coccinelle script was used:
use strict;
my @callers;
open($fd, 'git grep -l \'S_IS[A-Z].*->d_inode\' |') ||
die "Can't grep for S_ISDIR and co. callers";
@callers = <$fd>;
close($fd);
unless (@callers) {
print "No matches\n";
exit(0);
}
my @cocci = (
'@@',
'expression E;',
'@@',
'',
'- S_ISLNK(E->d_inode->i_mode)',
'+ d_is_symlink(E)',
'',
'@@',
'expression E;',
'@@',
'',
'- S_ISDIR(E->d_inode->i_mode)',
'+ d_is_dir(E)',
'',
'@@',
'expression E;',
'@@',
'',
'- S_ISREG(E->d_inode->i_mode)',
'+ d_is_reg(E)' );
my $coccifile = "tmp.sp.cocci";
open($fd, ">$coccifile") || die $coccifile;
print($fd "$_\n") || die $coccifile foreach (@cocci);
close($fd);
foreach my $file (@callers) {
chomp $file;
print "Processing ", $file, "\n";
system("spatch", "--sp-file", $coccifile, $file, "--in-place", "--no-show-diff") == 0 ||
die "spatch failed";
}
[AV: overlayfs parts skipped]
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-01-29 12:02:35 +00:00
|
|
|
|
2007-06-27 14:09:44 -07:00
|
|
|
|
VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry)
Convert the following where appropriate:
(1) S_ISLNK(dentry->d_inode) to d_is_symlink(dentry).
(2) S_ISREG(dentry->d_inode) to d_is_reg(dentry).
(3) S_ISDIR(dentry->d_inode) to d_is_dir(dentry). This is actually more
complicated than it appears as some calls should be converted to
d_can_lookup() instead. The difference is whether the directory in
question is a real dir with a ->lookup op or whether it's a fake dir with
a ->d_automount op.
In some circumstances, we can subsume checks for dentry->d_inode not being
NULL into this, provided we the code isn't in a filesystem that expects
d_inode to be NULL if the dirent really *is* negative (ie. if we're going to
use d_inode() rather than d_backing_inode() to get the inode pointer).
Note that the dentry type field may be set to something other than
DCACHE_MISS_TYPE when d_inode is NULL in the case of unionmount, where the VFS
manages the fall-through from a negative dentry to a lower layer. In such a
case, the dentry type of the negative union dentry is set to the same as the
type of the lower dentry.
However, if you know d_inode is not NULL at the call site, then you can use
the d_is_xxx() functions even in a filesystem.
There is one further complication: a 0,0 chardev dentry may be labelled
DCACHE_WHITEOUT_TYPE rather than DCACHE_SPECIAL_TYPE. Strictly, this was
intended for special directory entry types that don't have attached inodes.
The following perl+coccinelle script was used:
use strict;
my @callers;
open($fd, 'git grep -l \'S_IS[A-Z].*->d_inode\' |') ||
die "Can't grep for S_ISDIR and co. callers";
@callers = <$fd>;
close($fd);
unless (@callers) {
print "No matches\n";
exit(0);
}
my @cocci = (
'@@',
'expression E;',
'@@',
'',
'- S_ISLNK(E->d_inode->i_mode)',
'+ d_is_symlink(E)',
'',
'@@',
'expression E;',
'@@',
'',
'- S_ISDIR(E->d_inode->i_mode)',
'+ d_is_dir(E)',
'',
'@@',
'expression E;',
'@@',
'',
'- S_ISREG(E->d_inode->i_mode)',
'+ d_is_reg(E)' );
my $coccifile = "tmp.sp.cocci";
open($fd, ">$coccifile") || die $coccifile;
print($fd "$_\n") || die $coccifile foreach (@cocci);
close($fd);
foreach my $file (@callers) {
chomp $file;
print "Processing ", $file, "\n";
system("spatch", "--sp-file", $coccifile, $file, "--in-place", "--no-show-diff") == 0 ||
die "spatch failed";
}
[AV: overlayfs parts skipped]
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-01-29 12:02:35 +00:00
|
|
|
|
2007-07-19 01:47:54 -07:00
|
|
|
|
|
|
|
|
|
2007-06-27 14:09:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-24 03:49:02 -05:00
|
|
|
|
eCryptfs: Add reference counting to lower files
For any given lower inode, eCryptfs keeps only one lower file open and
multiplexes all eCryptfs file operations through that lower file. The
lower file was considered "persistent" and stayed open from the first
lookup through the lifetime of the inode.
This patch keeps the notion of a single, per-inode lower file, but adds
reference counting around the lower file so that it is closed when not
currently in use. If the reference count is at 0 when an operation (such
as open, create, etc.) needs to use the lower file, a new lower file is
opened. Since the file is no longer persistent, all references to the
term persistent file are changed to lower file.
Locking is added around the sections of code that opens the lower file
and assign the pointer in the inode info, as well as the code the fputs
the lower file when all eCryptfs users are done with it.
This patch is needed to fix issues, when mounted on top of the NFSv3
client, where the lower file is left silly renamed until the eCryptfs
inode is destroyed.
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
2011-04-14 15:35:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:28:10 -07:00
|
|
|
|
eCryptfs: Add reference counting to lower files
For any given lower inode, eCryptfs keeps only one lower file open and
multiplexes all eCryptfs file operations through that lower file. The
lower file was considered "persistent" and stayed open from the first
lookup through the lifetime of the inode.
This patch keeps the notion of a single, per-inode lower file, but adds
reference counting around the lower file so that it is closed when not
currently in use. If the reference count is at 0 when an operation (such
as open, create, etc.) needs to use the lower file, a new lower file is
opened. Since the file is no longer persistent, all references to the
term persistent file are changed to lower file.
Locking is added around the sections of code that opens the lower file
and assign the pointer in the inode info, as well as the code the fputs
the lower file when all eCryptfs users are done with it.
This patch is needed to fix issues, when mounted on top of the NFSv3
client, where the lower file is left silly renamed until the eCryptfs
inode is destroyed.
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
2011-04-14 15:35:11 -05:00
|
|
|
|
2007-10-16 01:28:06 -07:00
|
|
|
|
2007-06-27 14:09:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-06 01:38:35 -08:00
|
|
|
|
2007-06-27 14:09:44 -07:00
|
|
|
|
2008-02-06 01:38:35 -08:00
|
|
|
|
|
|
|
|
|
2007-06-27 14:09:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-15 14:54:00 -05:00
|
|
|
|
|
|
|
|
|
2007-06-27 14:09:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
eCryptfs: Check inode changes in setattr
Most filesystems call inode_change_ok() very early in ->setattr(), but
eCryptfs didn't call it at all. It allowed the lower filesystem to make
the call in its ->setattr() function. Then, eCryptfs would copy the
appropriate inode attributes from the lower inode to the eCryptfs inode.
This patch changes that and actually calls inode_change_ok() on the
eCryptfs inode, fairly early in ecryptfs_setattr(). Ideally, the call
would happen earlier in ecryptfs_setattr(), but there are some possible
inode initialization steps that must happen first.
Since the call was already being made on the lower inode, the change in
functionality should be minimal, except for the case of a file extending
truncate call. In that case, inode_newsize_ok() was never being
called on the eCryptfs inode. Rather than inode_newsize_ok() catching
maximum file size errors early on, eCryptfs would encrypt zeroed pages
and write them to the lower filesystem until the lower filesystem's
write path caught the error in generic_write_checks(). This patch
introduces a new function, called ecryptfs_inode_newsize_ok(), which
checks if the new lower file size is within the appropriate limits when
the truncate operation will be growing the lower file.
In summary this change prevents eCryptfs truncate operations (and the
resulting page encryptions), which would exceed the lower filesystem
limits or FSIZE rlimits, from ever starting.
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reviewed-by: Li Wang <liwang@nudt.edu.cn>
Cc: <stable@vger.kernel.org>
2012-01-19 20:33:44 -06:00
|
|
|
|
2016-05-26 16:55:18 +02:00
|
|
|
|
eCryptfs: Check inode changes in setattr
Most filesystems call inode_change_ok() very early in ->setattr(), but
eCryptfs didn't call it at all. It allowed the lower filesystem to make
the call in its ->setattr() function. Then, eCryptfs would copy the
appropriate inode attributes from the lower inode to the eCryptfs inode.
This patch changes that and actually calls inode_change_ok() on the
eCryptfs inode, fairly early in ecryptfs_setattr(). Ideally, the call
would happen earlier in ecryptfs_setattr(), but there are some possible
inode initialization steps that must happen first.
Since the call was already being made on the lower inode, the change in
functionality should be minimal, except for the case of a file extending
truncate call. In that case, inode_newsize_ok() was never being
called on the eCryptfs inode. Rather than inode_newsize_ok() catching
maximum file size errors early on, eCryptfs would encrypt zeroed pages
and write them to the lower filesystem until the lower filesystem's
write path caught the error in generic_write_checks(). This patch
introduces a new function, called ecryptfs_inode_newsize_ok(), which
checks if the new lower file size is within the appropriate limits when
the truncate operation will be growing the lower file.
In summary this change prevents eCryptfs truncate operations (and the
resulting page encryptions), which would exceed the lower filesystem
limits or FSIZE rlimits, from ever starting.
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reviewed-by: Li Wang <liwang@nudt.edu.cn>
Cc: <stable@vger.kernel.org>
2012-01-19 20:33:44 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-18 03:05:17 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-14 16:18:27 -05:00
|
|
|
|
|
|
|
|
|
2007-10-18 03:05:17 -07:00
|
|
|
|
2016-01-22 15:40:57 -05:00
|
|
|
|
2011-09-20 17:19:26 -04:00
|
|
|
|
2016-01-22 15:40:57 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2009-12-02 19:51:54 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-17 12:19:35 -08:00
|
|
|
|
|
|
|
|
|
2010-03-22 00:41:35 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2010-03-22 00:41:35 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-11-29 22:51:47 -05:00
|
|
|
|
|
|
|
|
|
2010-03-22 00:41:35 -05:00
|
|
|
|
|
|
|
|
|
2013-11-29 22:51:47 -05:00
|
|
|
|
|
|
|
|
|
2010-03-22 00:41:35 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-17 12:19:35 -08:00
|
|
|
|
|
|
|
|
|
2009-11-04 02:48:01 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-24 02:18:08 -05:00
|
|
|
|
2009-11-04 02:48:01 -06:00
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-11-04 02:48:01 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-02-12 00:53:46 -08:00
|
|
|
|
2016-05-27 11:06:05 -04:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2016-09-29 17:48:42 +02:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-29 17:48:42 +02:00
|
|
|
|
2010-03-23 11:51:38 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2010-10-05 18:53:45 +02:00
|
|
|
|
2016-05-27 11:06:05 -04:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-16 01:28:10 -07:00
|
|
|
|
2016-04-11 00:48:00 -04:00
|
|
|
|
|
|
|
|
|
2007-10-16 01:28:10 -07:00
|
|
|
|
2016-09-29 17:48:42 +02:00
|
|
|
|
2007-10-16 01:28:10 -07:00
|
|
|
|
2016-09-29 17:48:42 +02:00
|
|
|
|
2010-03-23 11:51:38 -05:00
|
|
|
|
2007-10-16 01:28:10 -07:00
|
|
|
|
|
|
|
|
|
2016-04-11 00:48:00 -04:00
|
|
|
|
2016-09-29 17:48:42 +02:00
|
|
|
|
2016-04-11 00:48:00 -04:00
|
|
|
|
2007-10-16 01:28:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-06 01:38:32 -08:00
|
|
|
|
2016-04-11 00:48:00 -04:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2016-04-11 00:48:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2010-03-23 11:51:38 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2016-01-22 15:40:57 -05:00
|
|
|
|
2015-03-17 22:25:59 +00:00
|
|
|
|
2016-01-22 15:40:57 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-29 17:48:36 +02:00
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2016-09-29 17:48:42 +02:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2016-09-29 17:48:36 +02:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2016-09-29 17:48:36 +02:00
|
|
|
|
2016-09-29 17:48:42 +02:00
|
|
|
|
2010-03-23 11:51:38 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2016-09-29 17:48:36 +02:00
|
|
|
|
2016-09-29 17:48:42 +02:00
|
|
|
|
2016-09-29 17:48:36 +02:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-02-12 00:55:38 -08:00
|
|
|
|
2012-05-03 09:34:20 -04:00
|
|
|
|
2015-11-17 10:20:54 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2010-03-22 00:41:35 -05:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-02-12 00:55:38 -08:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-02-12 00:55:38 -08:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
|
|
|
|
|
2009-11-04 02:48:01 -06:00
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|
2016-09-29 17:48:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-04 02:16:22 -07:00
|
|
|
|