<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs, branch v3.2.35</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs?h=v3.2.35</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs?h=v3.2.35'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-12-06T11:20:35Z</updated>
<entry>
<title>jbd: Fix lock ordering bug in journal_unmap_buffer()</title>
<updated>2012-12-06T11:20:35Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2012-11-23T13:03:04Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3b830a12b24fcfd9d241de936b9b11e3b23e9c23'/>
<id>urn:sha1:3b830a12b24fcfd9d241de936b9b11e3b23e9c23</id>
<content type='text'>
commit 25389bb207987b5774182f763b9fb65ff08761c8 upstream.

Commit 09e05d48 introduced a wait for transaction commit into
journal_unmap_buffer() in the case we are truncating a buffer undergoing commit
in the page stradding i_size on a filesystem with blocksize &lt; pagesize. Sadly
we forgot to drop buffer lock before waiting for transaction commit and thus
deadlock is possible when kjournald wants to lock the buffer.

Fix the problem by dropping the buffer lock before waiting for transaction
commit. Since we are still holding page lock (and that is OK), buffer cannot
disappear under us.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>reiserfs: Move quota calls out of write lock</title>
<updated>2012-12-06T11:20:28Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2012-11-13T16:05:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=14c0699231bb44a3d492b6b5ef281e4e956ab015'/>
<id>urn:sha1:14c0699231bb44a3d492b6b5ef281e4e956ab015</id>
<content type='text'>
commit 7af11686933726e99af22901d622f9e161404e6b upstream.

Calls into highlevel quota code cannot happen under the write lock. These
calls take dqio_mutex which ranks above write lock. So drop write lock
before calling back into quota code.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>reiserfs: Protect reiserfs_quota_write() with write lock</title>
<updated>2012-12-06T11:20:27Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2012-11-13T17:25:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9711ee6c9eff253a85ea67e425d74d6ff5790aad'/>
<id>urn:sha1:9711ee6c9eff253a85ea67e425d74d6ff5790aad</id>
<content type='text'>
commit 361d94a338a3fd0cee6a4ea32bbc427ba228e628 upstream.

Calls into reiserfs journalling code and reiserfs_get_block() need to
be protected with write lock. We remove write lock around calls to high
level quota code in the next patch so these paths would suddently become
unprotected.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>reiserfs: Protect reiserfs_quota_on() with write lock</title>
<updated>2012-12-06T11:20:27Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2012-11-13T15:34:17Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d84f59d5a0b8630b22e186d792294924cdde5c54'/>
<id>urn:sha1:d84f59d5a0b8630b22e186d792294924cdde5c54</id>
<content type='text'>
commit b9e06ef2e8706fe669b51f4364e3aeed58639eb2 upstream.

In reiserfs_quota_on() we do quite some work - for example unpacking
tail of a quota file. Thus we have to hold write lock until a moment
we call back into the quota code.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
[bwh: Backported to 3.2: there is no distinction between USRQUOTA and
 GRPQUOTA mount options here]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>reiserfs: Fix lock ordering during remount</title>
<updated>2012-12-06T11:20:27Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2012-11-13T13:55:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=aa9e08323cd85f6b94a1f57c416a9dc417561f9b'/>
<id>urn:sha1:aa9e08323cd85f6b94a1f57c416a9dc417561f9b</id>
<content type='text'>
commit 3bb3e1fc47aca554e7e2cc4deeddc24750987ac2 upstream.

When remounting reiserfs dquot_suspend() or dquot_resume() can be called.
These functions take dqonoff_mutex which ranks above write lock so we have
to drop it before calling into quota code.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>xfs: drop buffer io reference when a bad bio is built</title>
<updated>2012-12-06T11:20:25Z</updated>
<author>
<name>Dave Chinner</name>
<email>dchinner@redhat.com</email>
</author>
<published>2012-11-12T11:09:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f72ba897949f861cc95267c215ec4f8b5e9d6599'/>
<id>urn:sha1:f72ba897949f861cc95267c215ec4f8b5e9d6599</id>
<content type='text'>
commit d69043c42d8c6414fa28ad18d99973aa6c1c2e24 upstream.

Error handling in xfs_buf_ioapply_map() does not handle IO reference
counts correctly. We increment the b_io_remaining count before
building the bio, but then fail to decrement it in the failure case.
This leads to the buffer never running IO completion and releasing
the reference that the IO holds, so at unmount we can leak the
buffer. This leak is captured by this assert failure during unmount:

XFS: Assertion failed: atomic_read(&amp;pag-&gt;pag_ref) == 0, file: fs/xfs/xfs_mount.c, line: 273

This is not a new bug - the b_io_remaining accounting has had this
problem for a long, long time - it's just very hard to get a
zero length bio being built by this code...

Further, the buffer IO error can be overwritten on a multi-segment
buffer by subsequent bio completions for partial sections of the
buffer. Hence we should only set the buffer error status if the
buffer is not already carrying an error status. This ensures that a
partial IO error on a multi-segment buffer will not be lost. This
part of the problem is a regression, however.

Signed-off-by: Dave Chinner &lt;dchinner@redhat.com&gt;
Reviewed-by: Mark Tinguely &lt;tinguely@sgi.com&gt;
Signed-off-by: Ben Myers &lt;bpm@sgi.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>jffs2: Fix lock acquisition order bug in jffs2_write_begin</title>
<updated>2012-12-06T11:20:22Z</updated>
<author>
<name>Thomas Betker</name>
<email>thomas.betker@freenet.de</email>
</author>
<published>2012-10-17T20:59:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e3bb00e3b611c48b83730c880d8406c35de5bb4b'/>
<id>urn:sha1:e3bb00e3b611c48b83730c880d8406c35de5bb4b</id>
<content type='text'>
commit 5ffd3412ae5536a4c57469cb8ea31887121dcb2e upstream.

jffs2_write_begin() first acquires the page lock, then f-&gt;sem. This
causes an AB-BA deadlock with jffs2_garbage_collect_live(), which first
acquires f-&gt;sem, then the page lock:

jffs2_garbage_collect_live
    mutex_lock(&amp;f-&gt;sem)                         (A)
    jffs2_garbage_collect_dnode
        jffs2_gc_fetch_page
            read_cache_page_async
                do_read_cache_page
                    lock_page(page)             (B)

jffs2_write_begin
    grab_cache_page_write_begin
        find_lock_page
            lock_page(page)                     (B)
    mutex_lock(&amp;f-&gt;sem)                         (A)

We fix this by restructuring jffs2_write_begin() to take f-&gt;sem before
the page lock. However, we make sure that f-&gt;sem is not held when
calling jffs2_reserve_space(), as this is not permitted by the locking
rules.

The deadlock above was observed multiple times on an SoC with a dual
ARMv7 (Cortex-A9), running the long-term 3.4.11 kernel; it occurred
when using scp to copy files from a host system to the ARM target
system. The fix was heavily tested on the same target system.

Signed-off-by: Thomas Betker &lt;thomas.betker@rohde-schwarz.com&gt;
Acked-by: Joakim Tjernlund &lt;Joakim.Tjernlund@transmode.se&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
[bwh: Backported to 3.2:
 - Adjust context
 - Use D1(printk(KERN_DEBUG ...)) instead of jffs2_dbg(1, ...)]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>GFS2: Test bufdata with buffer locked and gfs2_log_lock held</title>
<updated>2012-12-06T11:20:17Z</updated>
<author>
<name>Benjamin Marzinski</name>
<email>bmarzins@redhat.com</email>
</author>
<published>2012-11-07T06:38:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=23da2a1f5e79c95dbae9c88848b57e39af80b326'/>
<id>urn:sha1:23da2a1f5e79c95dbae9c88848b57e39af80b326</id>
<content type='text'>
commit 96e5d1d3adf56f1c7eeb07258f6a1a0a7ae9c489 upstream.

In gfs2_trans_add_bh(), gfs2 was testing if a there was a bd attached to the
buffer without having the gfs2_log_lock held. It was then assuming it would
stay attached for the rest of the function. However, without either the log
lock being held of the buffer locked, __gfs2_ail_flush() could detach bd at any
time.  This patch moves the locking before the test.  If there isn't a bd
already attached, gfs2 can safely allocate one and attach it before locking.
There is no way that the newly allocated bd could be on the ail list,
and thus no way for __gfs2_ail_flush() to detach it.

Signed-off-by: Benjamin Marzinski &lt;bmarzins@redhat.com&gt;
Signed-off-by: Steven Whitehouse &lt;swhiteho@redhat.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>UBIFS: fix mounting problems after power cuts</title>
<updated>2012-12-06T11:20:01Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>artem.bityutskiy@linux.intel.com</email>
</author>
<published>2012-10-09T13:20:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c26a0f67479f10d0241a79c306eb1b9002e98d51'/>
<id>urn:sha1:c26a0f67479f10d0241a79c306eb1b9002e98d51</id>
<content type='text'>
commit a28ad42a4a0c6f302f488f26488b8b37c9b30024 upstream.

This is a bugfix for a problem with the following symptoms:

1. A power cut happens
2. After reboot, we try to mount UBIFS
3. Mount fails with "No space left on device" error message

UBIFS complains like this:

UBIFS error (pid 28225): grab_empty_leb: could not find an empty LEB

The root cause of this problem is that when we mount, not all LEBs are
categorized. Only those which were read are. However, the
'ubifs_find_free_leb_for_idx()' function assumes that all LEBs were
categorized and 'c-&gt;freeable_cnt' is valid, which is a false assumption.

This patch fixes the problem by teaching 'ubifs_find_free_leb_for_idx()'
to always fall back to LPT scanning if no freeable LEBs were found.

This problem was reported by few people in the past, but Brent Taylor
was able to reproduce it and send me a flash image which cannot be mounted,
which made it easy to hunt the bug. Kudos to Brent.

Reported-by: Brent Taylor &lt;motobud@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>UBIFS: introduce categorized lprops counter</title>
<updated>2012-12-06T11:20:01Z</updated>
<author>
<name>Artem Bityutskiy</name>
<email>artem.bityutskiy@linux.intel.com</email>
</author>
<published>2012-10-10T07:55:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fd132e0440dfad94d4cda744377c81da474d53b9'/>
<id>urn:sha1:fd132e0440dfad94d4cda744377c81da474d53b9</id>
<content type='text'>
commit 98a1eebda3cb2a84ecf1f219bb3a95769033d1bf upstream.

This commit is a preparation for a subsequent bugfix. We introduce a
counter for categorized lprops.

Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
</feed>
