<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/ecryptfs/mmap.c, branch linux-2.6.28.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.28.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.28.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2009-01-18T18:43:46Z</updated>
<entry>
<title>fs: symlink write_begin allocation context fix</title>
<updated>2009-01-18T18:43:46Z</updated>
<author>
<name>Nick Piggin</name>
</author>
<published>2009-01-04T20:00:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4f093b80fa8facbd22fa36c00242e2fffa36e12f'/>
<id>urn:sha1:4f093b80fa8facbd22fa36c00242e2fffa36e12f</id>
<content type='text'>
commit 54566b2c1594c2326a645a3551f9d989f7ba3c5e upstream.

With the write_begin/write_end aops, page_symlink was broken because it
could no longer pass a GFP_NOFS type mask into the point where the
allocations happened.  They are done in write_begin, which would always
assume that the filesystem can be entered from reclaim.  This bug could
cause filesystem deadlocks.

The funny thing with having a gfp_t mask there is that it doesn't really
allow the caller to arbitrarily tinker with the context in which it can be
called.  It couldn't ever be GFP_ATOMIC, for example, because it needs to
take the page lock.  The only thing any callers care about is __GFP_FS
anyway, so turn that into a single flag.

Add a new flag for write_begin, AOP_FLAG_NOFS.  Filesystems can now act on
this flag in their write_begin function.  Change __grab_cache_page to
accept a nofs argument as well, to honour that flag (while we're there,
change the name to grab_cache_page_write_begin which is more instructive
and does away with random leading underscores).

This is really a more flexible way to go in the end anyway -- if a
filesystem happens to want any extra allocations aside from the pagecache
ones in ints write_begin function, it may now use GFP_KERNEL (rather than
GFP_NOFS) for common case allocations (eg.  ocfs2_alloc_write_ctxt, for a
random example).

[kosaki.motohiro@jp.fujitsu.com: fix ubifs]
[kosaki.motohiro@jp.fujitsu.com: fix fuse]
Signed-off-by: Nick Piggin &lt;npiggin@suse.de&gt;
Reviewed-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Signed-off-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
[ Cleaned up the calling convention: just pass in the AOP flags
  untouched to the grab_cache_page_write_begin() function.  That
  just simplifies everybody, and may even allow future expansion of the
  logic.   - Linus ]
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>ecryptfs: convert to use new aops</title>
<updated>2008-10-16T18:21:39Z</updated>
<author>
<name>Badari Pulavarty</name>
</author>
<published>2008-10-16T05:02:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=807b7ebe41ab80d96e89a53bc290d49613e56f48'/>
<id>urn:sha1:807b7ebe41ab80d96e89a53bc290d49613e56f48</id>
<content type='text'>
Convert ecryptfs to use write_begin/write_end

Signed-off-by: Nick Piggin &lt;npiggin@suse.de&gt;
Signed-off-by: Badari Pulavarty &lt;pbadari@us.ibm.com&gt;
Acked-by: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Cc: Dave Kleikamp &lt;shaggy@austin.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ecryptfs: inode.c mmap.c use unaligned byteorder helpers</title>
<updated>2008-07-24T17:47:31Z</updated>
<author>
<name>Harvey Harrison</name>
</author>
<published>2008-07-24T04:30:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0a688ad713949643e201431d3f4a4ceddfeb70ca'/>
<id>urn:sha1:0a688ad713949643e201431d3f4a4ceddfeb70ca</id>
<content type='text'>
Fixe sparse warnings:
fs/ecryptfs/inode.c:368:15: warning: cast to restricted __be64
fs/ecryptfs/mmap.c:385:12: warning: incorrect type in assignment (different base types)
fs/ecryptfs/mmap.c:385:12:    expected unsigned long long [unsigned] [assigned] [usertype] file_size
fs/ecryptfs/mmap.c:385:12:    got restricted __be64 [usertype] &lt;noident&gt;
fs/ecryptfs/mmap.c:428:12: warning: incorrect type in assignment (different base types)
fs/ecryptfs/mmap.c:428:12:    expected unsigned long long [unsigned] [assigned] [usertype] file_size
fs/ecryptfs/mmap.c:428:12:    got restricted __be64 [usertype] &lt;noident&gt;

Signed-off-by: Harvey Harrison &lt;harvey.harrison@gmail.com&gt;
Cc: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ecryptfs: replace remaining __FUNCTION__ occurrences</title>
<updated>2008-04-29T15:06:06Z</updated>
<author>
<name>Harvey Harrison</name>
</author>
<published>2008-04-29T07:59:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=18d1dbf1d401e8f9d74cf1cf799fdb19cff150c6'/>
<id>urn:sha1:18d1dbf1d401e8f9d74cf1cf799fdb19cff150c6</id>
<content type='text'>
__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison &lt;harvey.harrison@gmail.com&gt;
Cc: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>eCryptfs: make ecryptfs_prepare_write decrypt the page</title>
<updated>2008-03-05T00:35:16Z</updated>
<author>
<name>Michael Halcrow</name>
</author>
<published>2008-03-04T22:29:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e4465fdaeb3f7b5ef47f389d3eac76db79ff20d8'/>
<id>urn:sha1:e4465fdaeb3f7b5ef47f389d3eac76db79ff20d8</id>
<content type='text'>
When the page is not up to date, ecryptfs_prepare_write() should be
acting much like ecryptfs_readpage(). This includes the painfully
obvious step of actually decrypting the page contents read from the
lower encrypted file.

Note that this patch resolves a bug in eCryptfs in 2.6.24 that one can
produce with these steps:

# mount -t ecryptfs /secret /secret
# echo "abc" &gt; /secret/file.txt
# umount /secret
# mount -t ecryptfs /secret /secret
# echo "def" &gt;&gt; /secret/file.txt
# cat /secret/file.txt

Without this patch, the resulting data returned from cat is likely to
be something other than "abc\ndef\n".

(Thanks to Benedikt Driessen for reporting this.)

Signed-off-by: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Cc: Benedikt Driessen &lt;bdriessen@escrypt.com&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>eCryptfs: track header bytes rather than extents</title>
<updated>2008-02-06T18:41:12Z</updated>
<author>
<name>Michael Halcrow</name>
</author>
<published>2008-02-06T09:38:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cc11beffdf80ca31dff21422fa2a5e54d25f1494'/>
<id>urn:sha1:cc11beffdf80ca31dff21422fa2a5e54d25f1494</id>
<content type='text'>
Remove internal references to header extents; just keep track of header bytes
instead.  Headers can easily span multiple pages with the recent persistent
file changes.

Signed-off-by: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fs/ecryptfs/: possible cleanups</title>
<updated>2008-02-06T18:41:12Z</updated>
<author>
<name>Adrian Bunk</name>
</author>
<published>2008-02-06T09:38:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7896b631823c6e8f1a520d89390624a51445840e'/>
<id>urn:sha1:7896b631823c6e8f1a520d89390624a51445840e</id>
<content type='text'>
- make the following needlessly global code static:
  - crypto.c:ecryptfs_lower_offset_for_extent()
  - crypto.c:key_tfm_list
  - crypto.c:key_tfm_list_mutex
  - inode.c:ecryptfs_getxattr()
  - main.c:ecryptfs_init_persistent_file()

- remove the no longer used mmap.c:ecryptfs_lower_page_cache

- #if 0 the unused read_write.c:ecryptfs_read()

Signed-off-by: Adrian Bunk &lt;bunk@kernel.org&gt;
Cc: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Pagecache zeroing: zero_user_segment, zero_user_segments and zero_user</title>
<updated>2008-02-05T17:44:13Z</updated>
<author>
<name>Christoph Lameter</name>
</author>
<published>2008-02-05T06:28:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eebd2aa355692afaf9906f62118620f1a1c19dbb'/>
<id>urn:sha1:eebd2aa355692afaf9906f62118620f1a1c19dbb</id>
<content type='text'>
Simplify page cache zeroing of segments of pages through 3 functions

zero_user_segments(page, start1, end1, start2, end2)

        Zeros two segments of the page. It takes the position where to
        start and end the zeroing which avoids length calculations and
	makes code clearer.

zero_user_segment(page, start, end)

        Same for a single segment.

zero_user(page, start, length)

        Length variant for the case where we know the length.

We remove the zero_user_page macro. Issues:

1. Its a macro. Inline functions are preferable.

2. The KM_USER0 macro is only defined for HIGHMEM.

   Having to treat this special case everywhere makes the
   code needlessly complex. The parameter for zeroing is always
   KM_USER0 except in one single case that we open code.

Avoiding KM_USER0 makes a lot of code not having to be dealing
with the special casing for HIGHMEM anymore. Dealing with
kmap is only necessary for HIGHMEM configurations. In those
configurations we use KM_USER0 like we do for a series of other
functions defined in highmem.h.

Since KM_USER0 is depends on HIGHMEM the existing zero_user_page
function could not be a macro. zero_user_* functions introduced
here can be be inline because that constant is not used when these
functions are called.

Also extract the flushing of the caches to be outside of the kmap.

[akpm@linux-foundation.org: fix nfs and ntfs build]
[akpm@linux-foundation.org: fix ntfs build some more]
Signed-off-by: Christoph Lameter &lt;clameter@sgi.com&gt;
Cc: Steven French &lt;sfrench@us.ibm.com&gt;
Cc: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Cc: &lt;linux-ext4@vger.kernel.org&gt;
Cc: Steven Whitehouse &lt;swhiteho@redhat.com&gt;
Cc: Trond Myklebust &lt;trond.myklebust@fys.uio.no&gt;
Cc: "J. Bruce Fields" &lt;bfields@fieldses.org&gt;
Cc: Anton Altaparmakov &lt;aia21@cantab.net&gt;
Cc: Mark Fasheh &lt;mark.fasheh@oracle.com&gt;
Cc: David Chinner &lt;dgc@sgi.com&gt;
Cc: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Cc: Steven French &lt;sfrench@us.ibm.com&gt;
Cc: Steven Whitehouse &lt;swhiteho@redhat.com&gt;
Cc: Trond Myklebust &lt;trond.myklebust@fys.uio.no&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ecryptfs: fix fsx data corruption problems</title>
<updated>2007-12-18T03:28:17Z</updated>
<author>
<name>Eric Sandeen</name>
</author>
<published>2007-12-18T00:20:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7a3f595cc8298df14a7c71b0d876bafd8e9e1cbf'/>
<id>urn:sha1:7a3f595cc8298df14a7c71b0d876bafd8e9e1cbf</id>
<content type='text'>
ecryptfs in 2.6.24-rc3 wasn't surviving fsx for me at all, dying after 4
ops.  Generally, encountering problems with stale data and improperly
zeroed pages.  An extending truncate + write for example would expose stale
data.

With the changes below I got to a million ops and beyond with all mmap ops
disabled - mmap still needs work.  (A version of this patch on a RHEL5
kernel ran for over 110 million fsx ops)

I added a few comments as well, to the best of my understanding
as I read through the code.

Signed-off-by: Eric Sandeen &lt;sandeen@redhat.com&gt;
Acked-by: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ecryptfs: clean up page flag handling</title>
<updated>2007-10-16T16:43:12Z</updated>
<author>
<name>Michael Halcrow</name>
</author>
<published>2007-10-16T08:28:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=16a72c455a67bb23eed7292a31c6ba17729e78e6'/>
<id>urn:sha1:16a72c455a67bb23eed7292a31c6ba17729e78e6</id>
<content type='text'>
The functions that eventually call down to ecryptfs_read_lower(),
ecryptfs_decrypt_page(), and ecryptfs_copy_up_encrypted_with_header()
should have the responsibility of managing the page Uptodate
status. This patch gets rid of some of the ugliness that resulted from
trying to push some of the page flag setting too far down the stack.

Signed-off-by: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
