<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/fs, branch v3.10.47</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10.47</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10.47'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2014-07-07T01:54:15Z</updated>
<entry>
<title>reiserfs: call truncate_setsize under tailpack mutex</title>
<updated>2014-07-07T01:54:15Z</updated>
<author>
<name>Jeff Mahoney</name>
<email>jeffm@suse.com</email>
</author>
<published>2014-05-21T17:28:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4660efb843558ced86491e8582da9b671280952c'/>
<id>urn:sha1:4660efb843558ced86491e8582da9b671280952c</id>
<content type='text'>
commit 22e7478ddbcb670e33fab72d0bbe7c394c3a2c84 upstream.

Prior to commit 0e4f6a791b1e (Fix reiserfs_file_release()), reiserfs
truncates serialized on i_mutex. They mostly still do, with the exception
of reiserfs_file_release. That blocks out other writers via the tailpack
mutex and the inode openers counter adjusted in reiserfs_file_open.

However, NFS will call reiserfs_setattr without having called -&gt;open, so
we end up with a race when nfs is calling -&gt;setattr while another
process is releasing the file. Ultimately, it triggers the
BUG_ON(inode-&gt;i_size != new_file_size) check in maybe_indirect_to_direct.

The solution is to pull the lock into reiserfs_setattr to encompass the
truncate_setsize call as well.

Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>nfsd: don't halt scanning the DRC LRU list when there's an RC_INPROG entry</title>
<updated>2014-07-07T01:54:14Z</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@primarydata.com</email>
</author>
<published>2014-06-05T13:45:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=548e6c6e202cb03f5bf5d79392fa4dcf1c1534cf'/>
<id>urn:sha1:548e6c6e202cb03f5bf5d79392fa4dcf1c1534cf</id>
<content type='text'>
commit 1b19453d1c6abcfa7c312ba6c9f11a277568fc94 upstream.

Currently, the DRC cache pruner will stop scanning the list when it
hits an entry that is RC_INPROG. It's possible however for a call to
take a *very* long time. In that case, we don't want it to block other
entries from being pruned if they are expired or we need to trim the
cache to get back under the limit.

Fix the DRC cache pruner to just ignore RC_INPROG entries.

Signed-off-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>nfsd: don't try to reuse an expired DRC entry off the list</title>
<updated>2014-07-07T01:54:14Z</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@redhat.com</email>
</author>
<published>2013-12-05T11:00:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=03e9dd7847298ea8328b914de8f4777e238cdb77'/>
<id>urn:sha1:03e9dd7847298ea8328b914de8f4777e238cdb77</id>
<content type='text'>
commit a0ef5e19684f0447da9ff0654a12019c484f57ca upstream.

Currently when we are processing a request, we try to scrape an expired
or over-limit entry off the list in preference to allocating a new one
from the slab.

This is unnecessarily complicated. Just use the slab layer.

Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>NFS: Don't declare inode uptodate unless all attributes were checked</title>
<updated>2014-07-07T01:54:14Z</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@primarydata.com</email>
</author>
<published>2014-04-15T14:07:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4b331d38a2add7b27ea44d26d9146ad1aabcbaab'/>
<id>urn:sha1:4b331d38a2add7b27ea44d26d9146ad1aabcbaab</id>
<content type='text'>
commit 43b6535e717d2f656f71d9bd16022136b781c934 upstream.

Fix a bug, whereby nfs_update_inode() was declaring the inode to be
up to date despite not having checked all the attributes.
The bug occurs because the temporary variable in which we cache
the validity information is 'sanitised' before reapplying to
nfsi-&gt;cache_validity.

Reported-by: Kinglong Mee &lt;kinglongmee@gmail.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>nfsd: getattr for FATTR4_WORD0_FILES_AVAIL needs the statfs buffer</title>
<updated>2014-07-07T01:54:14Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2014-05-28T08:46:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=32cf2fba27303e95f944f6452e42648297fc8b51'/>
<id>urn:sha1:32cf2fba27303e95f944f6452e42648297fc8b51</id>
<content type='text'>
commit 12337901d654415d9f764b5f5ba50052e9700f37 upstream.

Note nobody's ever noticed because the typical client probably never
requests FILES_AVAIL without also requesting something else on the list.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>nfsd4: fix FREE_STATEID lockowner leak</title>
<updated>2014-07-07T01:54:14Z</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@redhat.com</email>
</author>
<published>2014-05-27T15:14:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1dd6ffc6284cd2d81b667e58684701cf7d1c3d12'/>
<id>urn:sha1:1dd6ffc6284cd2d81b667e58684701cf7d1c3d12</id>
<content type='text'>
commit 48385408b45523d9a432c66292d47ef43efcbb94 upstream.

27b11428b7de ("nfsd4: remove lockowner when removing lock stateid")
introduced a memory leak.

Reported-by: Jeff Layton &lt;jeff.layton@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>pNFS: Handle allocation errors correctly in filelayout_alloc_layout_hdr()</title>
<updated>2014-07-07T01:54:14Z</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@primarydata.com</email>
</author>
<published>2014-05-30T00:06:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f1631672d6cbf0d836a4eb3617a26add4281d4a3'/>
<id>urn:sha1:f1631672d6cbf0d836a4eb3617a26add4281d4a3</id>
<content type='text'>
commit 6df200f5d5191bdde4d2e408215383890f956781 upstream.

Return the NULL pointer when the allocation fails.

Reported-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>UBIFS: Remove incorrect assertion in shrink_tnc()</title>
<updated>2014-07-07T01:54:13Z</updated>
<author>
<name>hujianyang</name>
<email>hujianyang@huawei.com</email>
</author>
<published>2014-05-31T03:39:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6f02490b96062bdd8a7914e1287a70c5a01d6a3d'/>
<id>urn:sha1:6f02490b96062bdd8a7914e1287a70c5a01d6a3d</id>
<content type='text'>
commit 72abc8f4b4e8574318189886de627a2bfe6cd0da upstream.

I hit the same assert failed as Dolev Raviv reported in Kernel v3.10
shows like this:

[ 9641.164028] UBIFS assert failed in shrink_tnc at 131 (pid 13297)
[ 9641.234078] CPU: 1 PID: 13297 Comm: mmap.test Tainted: G           O 3.10.40 #1
[ 9641.234116] [&lt;c0011a6c&gt;] (unwind_backtrace+0x0/0x12c) from [&lt;c000d0b0&gt;] (show_stack+0x20/0x24)
[ 9641.234137] [&lt;c000d0b0&gt;] (show_stack+0x20/0x24) from [&lt;c0311134&gt;] (dump_stack+0x20/0x28)
[ 9641.234188] [&lt;c0311134&gt;] (dump_stack+0x20/0x28) from [&lt;bf22425c&gt;] (shrink_tnc_trees+0x25c/0x350 [ubifs])
[ 9641.234265] [&lt;bf22425c&gt;] (shrink_tnc_trees+0x25c/0x350 [ubifs]) from [&lt;bf2245ac&gt;] (ubifs_shrinker+0x25c/0x310 [ubifs])
[ 9641.234307] [&lt;bf2245ac&gt;] (ubifs_shrinker+0x25c/0x310 [ubifs]) from [&lt;c00cdad8&gt;] (shrink_slab+0x1d4/0x2f8)
[ 9641.234327] [&lt;c00cdad8&gt;] (shrink_slab+0x1d4/0x2f8) from [&lt;c00d03d0&gt;] (do_try_to_free_pages+0x300/0x544)
[ 9641.234344] [&lt;c00d03d0&gt;] (do_try_to_free_pages+0x300/0x544) from [&lt;c00d0a44&gt;] (try_to_free_pages+0x2d0/0x398)
[ 9641.234363] [&lt;c00d0a44&gt;] (try_to_free_pages+0x2d0/0x398) from [&lt;c00c6a60&gt;] (__alloc_pages_nodemask+0x494/0x7e8)
[ 9641.234382] [&lt;c00c6a60&gt;] (__alloc_pages_nodemask+0x494/0x7e8) from [&lt;c00f62d8&gt;] (new_slab+0x78/0x238)
[ 9641.234400] [&lt;c00f62d8&gt;] (new_slab+0x78/0x238) from [&lt;c031081c&gt;] (__slab_alloc.constprop.42+0x1a4/0x50c)
[ 9641.234419] [&lt;c031081c&gt;] (__slab_alloc.constprop.42+0x1a4/0x50c) from [&lt;c00f80e8&gt;] (kmem_cache_alloc_trace+0x54/0x188)
[ 9641.234459] [&lt;c00f80e8&gt;] (kmem_cache_alloc_trace+0x54/0x188) from [&lt;bf227908&gt;] (do_readpage+0x168/0x468 [ubifs])
[ 9641.234553] [&lt;bf227908&gt;] (do_readpage+0x168/0x468 [ubifs]) from [&lt;bf2296a0&gt;] (ubifs_readpage+0x424/0x464 [ubifs])
[ 9641.234606] [&lt;bf2296a0&gt;] (ubifs_readpage+0x424/0x464 [ubifs]) from [&lt;c00c17c0&gt;] (filemap_fault+0x304/0x418)
[ 9641.234638] [&lt;c00c17c0&gt;] (filemap_fault+0x304/0x418) from [&lt;c00de694&gt;] (__do_fault+0xd4/0x530)
[ 9641.234665] [&lt;c00de694&gt;] (__do_fault+0xd4/0x530) from [&lt;c00e10c0&gt;] (handle_pte_fault+0x480/0xf54)
[ 9641.234690] [&lt;c00e10c0&gt;] (handle_pte_fault+0x480/0xf54) from [&lt;c00e2bf8&gt;] (handle_mm_fault+0x140/0x184)
[ 9641.234716] [&lt;c00e2bf8&gt;] (handle_mm_fault+0x140/0x184) from [&lt;c0316688&gt;] (do_page_fault+0x150/0x3ac)
[ 9641.234737] [&lt;c0316688&gt;] (do_page_fault+0x150/0x3ac) from [&lt;c000842c&gt;] (do_DataAbort+0x3c/0xa0)
[ 9641.234759] [&lt;c000842c&gt;] (do_DataAbort+0x3c/0xa0) from [&lt;c0314e38&gt;] (__dabt_usr+0x38/0x40)

After analyzing the code, I found a condition that may cause this failed
in correct operations. Thus, I think this assertion is wrong and should be
removed.

Suppose there are two clean znodes and one dirty znode in TNC. So the
per-filesystem atomic_t @clean_zn_cnt is (2). If commit start, dirty_znode
is set to COW_ZNODE in get_znodes_to_commit() in case of potentially ops
on this znode. We clear COW bit and DIRTY bit in write_index() without
@tnc_mutex locked. We don't increase @clean_zn_cnt in this place. As the
comments in write_index() shows, if another process hold @tnc_mutex and
dirty this znode after we clean it, @clean_zn_cnt would be decreased to (1).
We will increase @clean_zn_cnt to (2) with @tnc_mutex locked in
free_obsolete_znodes() to keep it right.

If shrink_tnc() performs between decrease and increase, it will release
other 2 clean znodes it holds and found @clean_zn_cnt is less than zero
(1 - 2 = -1), then hit the assertion. Because free_obsolete_znodes() will
soon correct @clean_zn_cnt and no harm to fs in this case, I think this
assertion could be removed.

2 clean zondes and 1 dirty znode, @clean_zn_cnt == 2

Thread A (commit)         Thread B (write or others)       Thread C (shrinker)
-&gt;write_index
   -&gt;clear_bit(DIRTY_NODE)
   -&gt;clear_bit(COW_ZNODE)

            @clean_zn_cnt == 2
                          -&gt;mutex_locked(&amp;tnc_mutex)
                          -&gt;dirty_cow_znode
                              -&gt;!ubifs_zn_cow(znode)
                              -&gt;!test_and_set_bit(DIRTY_NODE)
                              -&gt;atomic_dec(&amp;clean_zn_cnt)
                          -&gt;mutex_unlocked(&amp;tnc_mutex)

            @clean_zn_cnt == 1
                                                           -&gt;mutex_locked(&amp;tnc_mutex)
                                                           -&gt;shrink_tnc
                                                             -&gt;destroy_tnc_subtree
                                                             -&gt;atomic_sub(&amp;clean_zn_cnt, 2)
                                                             -&gt;ubifs_assert  &lt;- hit
                                                           -&gt;mutex_unlocked(&amp;tnc_mutex)

            @clean_zn_cnt == -1
-&gt;mutex_lock(&amp;tnc_mutex)
-&gt;free_obsolete_znodes
   -&gt;atomic_inc(&amp;clean_zn_cnt)
-&gt;mutux_unlock(&amp;tnc_mutex)

            @clean_zn_cnt == 0 (correct after shrink)

Signed-off-by: hujianyang &lt;hujianyang@huawei.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>UBIFS: fix an mmap and fsync race condition</title>
<updated>2014-07-07T01:54:13Z</updated>
<author>
<name>hujianyang</name>
<email>hujianyang@huawei.com</email>
</author>
<published>2014-04-30T06:06:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ac8df9ec7b4e25b87d5a71dfd9af4d8076d66bff'/>
<id>urn:sha1:ac8df9ec7b4e25b87d5a71dfd9af4d8076d66bff</id>
<content type='text'>
commit 691a7c6f28ac90cccd0dbcf81348ea90b211bdd0 upstream.

There is a race condition in UBIFS:

Thread A (mmap)                        Thread B (fsync)

-&gt;__do_fault                           -&gt;write_cache_pages
   -&gt; ubifs_vm_page_mkwrite
       -&gt; budget_space
       -&gt; lock_page
       -&gt; release/convert_page_budget
       -&gt; SetPagePrivate
       -&gt; TestSetPageDirty
       -&gt; unlock_page
                                       -&gt; lock_page
                                           -&gt; TestClearPageDirty
                                           -&gt; ubifs_writepage
                                               -&gt; do_writepage
                                                   -&gt; release_budget
                                                   -&gt; ClearPagePrivate
                                                   -&gt; unlock_page
   -&gt; !(ret &amp; VM_FAULT_LOCKED)
   -&gt; lock_page
   -&gt; set_page_dirty
       -&gt; ubifs_set_page_dirty
           -&gt; TestSetPageDirty (set page dirty without budgeting)
   -&gt; unlock_page

This leads to situation where we have a diry page but no budget allocated for
this page, so further write-back may fail with -ENOSPC.

In this fix we return from page_mkwrite without performing unlock_page. We
return VM_FAULT_LOCKED instead. After doing this, the race above will not
happen.

Signed-off-by: hujianyang &lt;hujianyang@huawei.com&gt;
Tested-by: Laurence Withers &lt;lwithers@guralp.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>btrfs: fix use of uninit "ret" in end_extent_writepage()</title>
<updated>2014-07-01T03:09:46Z</updated>
<author>
<name>Eric Sandeen</name>
<email>sandeen@redhat.com</email>
</author>
<published>2014-06-12T05:39:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=26401cbceb478fe203a415612b4c8d52194a9154'/>
<id>urn:sha1:26401cbceb478fe203a415612b4c8d52194a9154</id>
<content type='text'>
commit 3e2426bd0eb980648449e7a2f5a23e3cd3c7725c upstream.

If this condition in end_extent_writepage() is false:

	if (tree-&gt;ops &amp;&amp; tree-&gt;ops-&gt;writepage_end_io_hook)

we will then test an uninitialized "ret" at:

	ret = ret &lt; 0 ? ret : -EIO;

The test for ret is for the case where -&gt;writepage_end_io_hook
failed, and we'd choose that ret as the error; but if
there is no -&gt;writepage_end_io_hook, nothing sets ret.

Initializing ret to 0 should be sufficient; if
writepage_end_io_hook wasn't set, (!uptodate) means
non-zero err was passed in, so we choose -EIO in that case.

Signed-of-by: Eric Sandeen &lt;sandeen@redhat.com&gt;

Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
