<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/mbcache.h, branch v3.16.5</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.16.5</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.16.5'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2014-03-18T23:19:41Z</updated>
<entry>
<title>fs/mbcache.c: change block and index hash chain to hlist_bl_node</title>
<updated>2014-03-18T23:19:41Z</updated>
<author>
<name>T Makphaibulchoke</name>
<email>tmac@hp.com</email>
</author>
<published>2014-03-18T23:19:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3e037e5211252902a188a6a11aecd247409d0229'/>
<id>urn:sha1:3e037e5211252902a188a6a11aecd247409d0229</id>
<content type='text'>
This patch changes each mb_cache's both block and index hash chains to
use a hlist_bl_node, which contains a built-in lock.  This is the
first step in decoupling of locks serializing accesses to mb_cache
global data and each mb_cache_entry local data.

Signed-off-by: T. Makphaibulchoke &lt;tmac@hp.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext2: Resolve 'dereferencing pointer to incomplete type' when enabling EXT2_XATTR_DEBUG</title>
<updated>2011-01-10T18:04:08Z</updated>
<author>
<name>Josh Hunt</name>
<email>johunt@akamai.com</email>
</author>
<published>2010-12-27T21:46:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d96336b05d718b03ff03c94c0dc0cc283a29d534'/>
<id>urn:sha1:d96336b05d718b03ff03c94c0dc0cc283a29d534</id>
<content type='text'>
When I enable EXT2_XATTR_DEBUG in fs/ext2/xattr.c I get a build error stating
the following:

  CC      fs/ext2/xattr.o
fs/ext2/xattr.c: In function 'ext2_xattr_cache_insert':
fs/ext2/xattr.c:841: error: dereferencing pointer to incomplete type
fs/ext2/xattr.c:846: error: dereferencing pointer to incomplete type
make[2]: *** [fs/ext2/xattr.o] Error 1
make[1]: *** [fs/ext2] Error 2
make: *** [fs] Error 2

These lines reference ext2_xattr_cache-&gt;c_entry_count which is defined
in struct mb_cache. struct mb_cache is currently only defined in fs/mbcache.c.
Moving struct mb_cache definition to include/linux/mbcache.h to resolve the
issue.

Signed-off-by: Josh Hunt &lt;johunt@akamai.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>mbcache: Remove unused features</title>
<updated>2010-08-09T20:48:45Z</updated>
<author>
<name>Andreas Gruenbacher</name>
<email>agruen@suse.de</email>
</author>
<published>2010-07-19T16:19:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2aec7c523291621ebb68ba8e0bd9b52a26bb76ee'/>
<id>urn:sha1:2aec7c523291621ebb68ba8e0bd9b52a26bb76ee</id>
<content type='text'>
The mbcache code was written to support a variable number of indexes,
but all the existing users use exactly one index.  Simplify to code to
support only that case.

There are also no users of the cache entry free operation, and none of
the users keep extra data in cache entries.  Remove those features as
well.

Signed-off-by: Andreas Gruenbacher &lt;agruen@suse.de&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>vfs: fix possible deadlock in ext2, ext3, ext4 when using xattrs</title>
<updated>2008-04-16T02:35:41Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2008-04-15T21:34:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=335e92e8a515420bd47a6b0f01cb9a206c0ed6e4'/>
<id>urn:sha1:335e92e8a515420bd47a6b0f01cb9a206c0ed6e4</id>
<content type='text'>
mb_cache_entry_alloc() was allocating cache entries with GFP_KERNEL.  But
filesystems are calling this function while holding xattr_sem so possible
recursion into the fs violates locking ordering of xattr_sem and transaction
start / i_mutex for ext2-4.  Change mb_cache_entry_alloc() so that filesystems
can specify desired gfp mask and use GFP_NOFS from all of them.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Cc: &lt;linux-ext4@vger.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>[PATCH] gfp_t: fs/*</title>
<updated>2005-10-28T15:16:47Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2005-10-21T07:20:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=27496a8c67bef4d789d8e3c8317ca35813a507ae'/>
<id>urn:sha1:27496a8c67bef4d789d8e3c8317ca35813a507ae</id>
<content type='text'>
 - -&gt;releasepage() annotated (s/int/gfp_t), instances updated
 - missing gfp_t in fs/* added
 - fixed misannotation from the original sweep caught by bitwise checks:
   XFS used __nocast both for gfp_t and for flags used by XFS allocator.
   The latter left with unsigned int __nocast; we might want to add a
   different type for those but for now let's leave them alone.  That,
   BTW, is a case when __nocast use had been actively confusing - it had
   been used in the same code for two different and similar types, with
   no way to catch misuses.  Switch of gfp_t to bitwise had caught that
   immediately...

One tricky bit is left alone to be dealt with later - mapping-&gt;flags is
a mix of gfp_t and error indications.  Left alone for now.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] mbcache: Remove unused mb_cache_shrink parameter</title>
<updated>2005-07-27T23:26:07Z</updated>
<author>
<name>Andreas Gruenbacher</name>
<email>agruen@suse.de</email>
</author>
<published>2005-07-27T18:45:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8c52ab42c11b5a7fb44bb84c954d09968e90e9e7'/>
<id>urn:sha1:8c52ab42c11b5a7fb44bb84c954d09968e90e9e7</id>
<content type='text'>
The cache parameter to mb_cache_shrink isn't used.  We may as well remove
it.

Signed-off-by: Andreas Gruenbacher &lt;agruen@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] ext3/EA: Race in ext[23] xattr sharing code</title>
<updated>2005-01-15T07:35:57Z</updated>
<author>
<name>Andreas Gruenbacher</name>
<email>agruen@suse.de</email>
</author>
<published>2005-01-15T07:35:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=fd1ea9abe35beaa2402b90b83a4c47135b086613'/>
<id>urn:sha1:fd1ea9abe35beaa2402b90b83a4c47135b086613</id>
<content type='text'>
Andrew Tridgell and Stephen C.  Tweedie have reported two different Oopses
caused by a race condition in the mbcache, which is responsible for
extended attribute sharing in ext2 and ext3.  Stephen tracked down the bug;
I did the fix.

Explanation:

The mbcache caches the locations and content hashes of xattr blocks.  There
are two access strategies: [1] xattr block disposal via
mb_cache_entry_get(), [2] xattr block reuse (sharing) via
mb_cache_entry_find_{first,next}().  There is no locking between the two
methods, so between one mb_cache_entry_find_x and the next, a
mb_cache_entry_get might come in, unhash the cache entry, and change the
journaling state of the xattr buffer.  Subsequently, two things can happen:
[a] the next mb_cache_entry_find_x may try to follow the mbcache hash chain
starting from the entry that has become unhashed, which now is a stale
pointer, [b] the block may have become deallocated, and then we try to
reuse it.

Fix this by converting the mbcache into a readers-writer style lock, and
protect all block accesses in ext2/ext3 by the mbcache entry lock.  This
ensures that destroying blocks is an exclusive operation that may not
overlap xattr block reuse, while allowing multiple "re-users".  Write
access to the xattr block's buffer is protected by the buffer lock.  

Signed-off-by: Andreas Gruenbacher &lt;agruen@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] ext3/EA: mbcache cleanup</title>
<updated>2005-01-15T07:35:39Z</updated>
<author>
<name>Andreas Gruenbacher</name>
<email>agruen@suse.de</email>
</author>
<published>2005-01-15T07:35:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=401494b1615efb1922a380226b0bea3eccb22ff3'/>
<id>urn:sha1:401494b1615efb1922a380226b0bea3eccb22ff3</id>
<content type='text'>
There is no need to export struct mb_cache outside mbcache.c.  Move struct
mb_cache to fs/mbcache.c and remove the superfluous struct
mb_cache_entry_index declaration.

Signed-off-by: Andreas Gruenbacher &lt;agruen@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] remove dead code from fs/mbcache.c</title>
<updated>2004-10-19T01:02:18Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2004-10-19T01:02:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8704c669a5587e4b06807a6394e453582eb0633e'/>
<id>urn:sha1:8704c669a5587e4b06807a6394e453582eb0633e</id>
<content type='text'>
mb_cache_entry_takeout and mb_cache_entry_dup are totally unused.

Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] mbcache: add gfp_mask parameter to free() callback,</title>
<updated>2002-11-16T02:52:23Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@digeo.com</email>
</author>
<published>2002-11-16T02:52:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ea6d6fc75ce8a6af5b6e53119d3ce67c05f8236a'/>
<id>urn:sha1:ea6d6fc75ce8a6af5b6e53119d3ce67c05f8236a</id>
<content type='text'>
Patch from Andreas Gruenbacher &lt;agruen@suse.de&gt;

Add a gfp_mask parameter to the free() callback so that the callback can
safely do I/O, etc. The free callback can now also fail.  This will be
needed by reiserfs.

The order of entries on the cache entry lru is reversed so that
list_for_each_safe() can be used. Several helper functions that don't
make the code any better are removed. Finally, a couple of cosmetic
things.
</content>
</entry>
</feed>
