<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/fs, branch v3.12.35</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>locks: eliminate BUG() call when there's an unexpected lock on file close</title>
<updated>2014-12-06T15:02:10+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@redhat.com</email>
</author>
<published>2014-02-03T17:13:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=cac69a82453f8cf8097d0550d53942c5333f07de'/>
<id>cac69a82453f8cf8097d0550d53942c5333f07de</id>
<content type='text'>
commit 8c3cac5e6a85f03602ffe09c44f14418699e31ec upstream.

A leftover lock on the list is surely a sign of a problem of some sort,
but it's not necessarily a reason to panic the box. Instead, just log a
warning with some info about the lock, and then delete it like we would
any other lock.

In the event that the filesystem declares a -&gt;lock f_op, we may end up
leaking something, but that's generally preferable to an immediate
panic.

Acked-by: J. Bruce Fields &lt;bfields@fieldses.org&gt;
Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Cc: Markus Blank-Burian &lt;burian@muenster.de&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 8c3cac5e6a85f03602ffe09c44f14418699e31ec upstream.

A leftover lock on the list is surely a sign of a problem of some sort,
but it's not necessarily a reason to panic the box. Instead, just log a
warning with some info about the lock, and then delete it like we would
any other lock.

In the event that the filesystem declares a -&gt;lock f_op, we may end up
leaking something, but that's generally preferable to an immediate
panic.

Acked-by: J. Bruce Fields &lt;bfields@fieldses.org&gt;
Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Cc: Markus Blank-Burian &lt;burian@muenster.de&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>nfsd: Fix slot wake up race in the nfsv4.1 callback code</title>
<updated>2014-12-06T14:18:26+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@primarydata.com</email>
</author>
<published>2014-11-19T17:47:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=55c8dd290be7ca4e64432b837d774314add709c0'/>
<id>55c8dd290be7ca4e64432b837d774314add709c0</id>
<content type='text'>
commit c6c15e1ed303ffc47e696ea1c9a9df1761c1f603 upstream.

The currect code for nfsd41_cb_get_slot() and nfsd4_cb_done() has no
locking in order to guarantee atomicity, and so allows for races of
the form.

Task 1                                  Task 2
======                                  ======
if (test_and_set_bit(0) != 0) {
                                        clear_bit(0)
                                        rpc_wake_up_next(queue)
        rpc_sleep_on(queue)
        return false;
}

This patch breaks the race condition by adding a retest of the bit
after the call to rpc_sleep_on().

Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit c6c15e1ed303ffc47e696ea1c9a9df1761c1f603 upstream.

The currect code for nfsd41_cb_get_slot() and nfsd4_cb_done() has no
locking in order to guarantee atomicity, and so allows for races of
the form.

Task 1                                  Task 2
======                                  ======
if (test_and_set_bit(0) != 0) {
                                        clear_bit(0)
                                        rpc_wake_up_next(queue)
        rpc_sleep_on(queue)
        return false;
}

This patch breaks the race condition by adding a retest of the bit
after the call to rpc_sleep_on().

Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nfsd: correctly define v4.2 support attributes</title>
<updated>2014-12-06T14:18:25+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2014-11-08T12:11:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e030e3fc04533f70a52584ff4a54a33014286340'/>
<id>e030e3fc04533f70a52584ff4a54a33014286340</id>
<content type='text'>
commit 6d0ba0432a5e10bc714ba9c5adc460e726e5fbb4 upstream.

Even when security labels are disabled we support at least the same
attributes as v4.1.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 6d0ba0432a5e10bc714ba9c5adc460e726e5fbb4 upstream.

Even when security labels are disabled we support at least the same
attributes as v4.1.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>aio: fix uncorrent dirty pages accouting when truncating AIO ring buffer</title>
<updated>2014-12-06T14:18:19+00:00</updated>
<author>
<name>Gu Zheng</name>
<email>guz.fnst@cn.fujitsu.com</email>
</author>
<published>2014-11-06T09:46:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=cab86d8c6534900243994bb0558e66a41fcbc39d'/>
<id>cab86d8c6534900243994bb0558e66a41fcbc39d</id>
<content type='text'>
commit 835f252c6debd204fcd607c79975089b1ecd3472 upstream.

https://bugzilla.kernel.org/show_bug.cgi?id=86831

Markus reported that when shutting down mysqld (with AIO support,
on a ext3 formatted Harddrive) leads to a negative number of dirty pages
(underrun to the counter). The negative number results in a drastic reduction
of the write performance because the page cache is not used, because the kernel
thinks it is still 2 ^ 32 dirty pages open.

Add a warn trace in __dec_zone_state will catch this easily:

static inline void __dec_zone_state(struct zone *zone, enum
	zone_stat_item item)
{
     atomic_long_dec(&amp;zone-&gt;vm_stat[item]);
+    WARN_ON_ONCE(item == NR_FILE_DIRTY &amp;&amp;
	atomic_long_read(&amp;zone-&gt;vm_stat[item]) &lt; 0);
     atomic_long_dec(&amp;vm_stat[item]);
}

[   21.341632] ------------[ cut here ]------------
[   21.346294] WARNING: CPU: 0 PID: 309 at include/linux/vmstat.h:242
cancel_dirty_page+0x164/0x224()
[   21.355296] Modules linked in: wutbox_cp sata_mv
[   21.359968] CPU: 0 PID: 309 Comm: kworker/0:1 Not tainted 3.14.21-WuT #80
[   21.366793] Workqueue: events free_ioctx
[   21.370760] [&lt;c0016a64&gt;] (unwind_backtrace) from [&lt;c0012f88&gt;]
(show_stack+0x20/0x24)
[   21.378562] [&lt;c0012f88&gt;] (show_stack) from [&lt;c03f8ccc&gt;]
(dump_stack+0x24/0x28)
[   21.385840] [&lt;c03f8ccc&gt;] (dump_stack) from [&lt;c0023ae4&gt;]
(warn_slowpath_common+0x84/0x9c)
[   21.393976] [&lt;c0023ae4&gt;] (warn_slowpath_common) from [&lt;c0023bb8&gt;]
(warn_slowpath_null+0x2c/0x34)
[   21.402800] [&lt;c0023bb8&gt;] (warn_slowpath_null) from [&lt;c00c0688&gt;]
(cancel_dirty_page+0x164/0x224)
[   21.411524] [&lt;c00c0688&gt;] (cancel_dirty_page) from [&lt;c00c080c&gt;]
(truncate_inode_page+0x8c/0x158)
[   21.420272] [&lt;c00c080c&gt;] (truncate_inode_page) from [&lt;c00c0a94&gt;]
(truncate_inode_pages_range+0x11c/0x53c)
[   21.429890] [&lt;c00c0a94&gt;] (truncate_inode_pages_range) from
[&lt;c00c0f6c&gt;] (truncate_pagecache+0x88/0xac)
[   21.439252] [&lt;c00c0f6c&gt;] (truncate_pagecache) from [&lt;c00c0fec&gt;]
(truncate_setsize+0x5c/0x74)
[   21.447731] [&lt;c00c0fec&gt;] (truncate_setsize) from [&lt;c013b3a8&gt;]
(put_aio_ring_file.isra.14+0x34/0x90)
[   21.456826] [&lt;c013b3a8&gt;] (put_aio_ring_file.isra.14) from
[&lt;c013b424&gt;] (aio_free_ring+0x20/0xcc)
[   21.465660] [&lt;c013b424&gt;] (aio_free_ring) from [&lt;c013b4f4&gt;]
(free_ioctx+0x24/0x44)
[   21.473190] [&lt;c013b4f4&gt;] (free_ioctx) from [&lt;c003d8d8&gt;]
(process_one_work+0x134/0x47c)
[   21.481132] [&lt;c003d8d8&gt;] (process_one_work) from [&lt;c003e988&gt;]
(worker_thread+0x130/0x414)
[   21.489350] [&lt;c003e988&gt;] (worker_thread) from [&lt;c00448ac&gt;]
(kthread+0xd4/0xec)
[   21.496621] [&lt;c00448ac&gt;] (kthread) from [&lt;c000ec18&gt;]
(ret_from_fork+0x14/0x20)
[   21.503884] ---[ end trace 79c4bf42c038c9a1 ]---

The cause is that we set the aio ring file pages as *DIRTY* via SetPageDirty
(bypasses the VFS dirty pages increment) when init, and aio fs uses
*default_backing_dev_info* as the backing dev, which does not disable
the dirty pages accounting capability.
So truncating aio ring file will contribute to accounting dirty pages (VFS
dirty pages decrement), then error occurs.

The original goal is keeping these pages in memory (can not be reclaimed
or swapped) in life-time via marking it dirty. But thinking more, we have
already pinned pages via elevating the page's refcount, which can already
achieve the goal, so the SetPageDirty seems unnecessary.

In order to fix the issue, using the __set_page_dirty_no_writeback instead
of the nop .set_page_dirty, and dropped the SetPageDirty (don't manually
set the dirty flags, don't disable set_page_dirty(), rely on default behaviour).

With the above change, the dirty pages accounting can work well. But as we
known, aio fs is an anonymous one, which should never cause any real write-back,
we can ignore the dirty pages (write back) accounting by disabling the dirty
pages (write back) accounting capability. So we introduce an aio private
backing dev info (disabled the ACCT_DIRTY/WRITEBACK/ACCT_WB capabilities) to
replace the default one.

Reported-by: Markus Königshaus &lt;m.koenigshaus@wut.de&gt;
Signed-off-by: Gu Zheng &lt;guz.fnst@cn.fujitsu.com&gt;
Acked-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Benjamin LaHaise &lt;bcrl@kvack.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 835f252c6debd204fcd607c79975089b1ecd3472 upstream.

https://bugzilla.kernel.org/show_bug.cgi?id=86831

Markus reported that when shutting down mysqld (with AIO support,
on a ext3 formatted Harddrive) leads to a negative number of dirty pages
(underrun to the counter). The negative number results in a drastic reduction
of the write performance because the page cache is not used, because the kernel
thinks it is still 2 ^ 32 dirty pages open.

Add a warn trace in __dec_zone_state will catch this easily:

static inline void __dec_zone_state(struct zone *zone, enum
	zone_stat_item item)
{
     atomic_long_dec(&amp;zone-&gt;vm_stat[item]);
+    WARN_ON_ONCE(item == NR_FILE_DIRTY &amp;&amp;
	atomic_long_read(&amp;zone-&gt;vm_stat[item]) &lt; 0);
     atomic_long_dec(&amp;vm_stat[item]);
}

[   21.341632] ------------[ cut here ]------------
[   21.346294] WARNING: CPU: 0 PID: 309 at include/linux/vmstat.h:242
cancel_dirty_page+0x164/0x224()
[   21.355296] Modules linked in: wutbox_cp sata_mv
[   21.359968] CPU: 0 PID: 309 Comm: kworker/0:1 Not tainted 3.14.21-WuT #80
[   21.366793] Workqueue: events free_ioctx
[   21.370760] [&lt;c0016a64&gt;] (unwind_backtrace) from [&lt;c0012f88&gt;]
(show_stack+0x20/0x24)
[   21.378562] [&lt;c0012f88&gt;] (show_stack) from [&lt;c03f8ccc&gt;]
(dump_stack+0x24/0x28)
[   21.385840] [&lt;c03f8ccc&gt;] (dump_stack) from [&lt;c0023ae4&gt;]
(warn_slowpath_common+0x84/0x9c)
[   21.393976] [&lt;c0023ae4&gt;] (warn_slowpath_common) from [&lt;c0023bb8&gt;]
(warn_slowpath_null+0x2c/0x34)
[   21.402800] [&lt;c0023bb8&gt;] (warn_slowpath_null) from [&lt;c00c0688&gt;]
(cancel_dirty_page+0x164/0x224)
[   21.411524] [&lt;c00c0688&gt;] (cancel_dirty_page) from [&lt;c00c080c&gt;]
(truncate_inode_page+0x8c/0x158)
[   21.420272] [&lt;c00c080c&gt;] (truncate_inode_page) from [&lt;c00c0a94&gt;]
(truncate_inode_pages_range+0x11c/0x53c)
[   21.429890] [&lt;c00c0a94&gt;] (truncate_inode_pages_range) from
[&lt;c00c0f6c&gt;] (truncate_pagecache+0x88/0xac)
[   21.439252] [&lt;c00c0f6c&gt;] (truncate_pagecache) from [&lt;c00c0fec&gt;]
(truncate_setsize+0x5c/0x74)
[   21.447731] [&lt;c00c0fec&gt;] (truncate_setsize) from [&lt;c013b3a8&gt;]
(put_aio_ring_file.isra.14+0x34/0x90)
[   21.456826] [&lt;c013b3a8&gt;] (put_aio_ring_file.isra.14) from
[&lt;c013b424&gt;] (aio_free_ring+0x20/0xcc)
[   21.465660] [&lt;c013b424&gt;] (aio_free_ring) from [&lt;c013b4f4&gt;]
(free_ioctx+0x24/0x44)
[   21.473190] [&lt;c013b4f4&gt;] (free_ioctx) from [&lt;c003d8d8&gt;]
(process_one_work+0x134/0x47c)
[   21.481132] [&lt;c003d8d8&gt;] (process_one_work) from [&lt;c003e988&gt;]
(worker_thread+0x130/0x414)
[   21.489350] [&lt;c003e988&gt;] (worker_thread) from [&lt;c00448ac&gt;]
(kthread+0xd4/0xec)
[   21.496621] [&lt;c00448ac&gt;] (kthread) from [&lt;c000ec18&gt;]
(ret_from_fork+0x14/0x20)
[   21.503884] ---[ end trace 79c4bf42c038c9a1 ]---

The cause is that we set the aio ring file pages as *DIRTY* via SetPageDirty
(bypasses the VFS dirty pages increment) when init, and aio fs uses
*default_backing_dev_info* as the backing dev, which does not disable
the dirty pages accounting capability.
So truncating aio ring file will contribute to accounting dirty pages (VFS
dirty pages decrement), then error occurs.

The original goal is keeping these pages in memory (can not be reclaimed
or swapped) in life-time via marking it dirty. But thinking more, we have
already pinned pages via elevating the page's refcount, which can already
achieve the goal, so the SetPageDirty seems unnecessary.

In order to fix the issue, using the __set_page_dirty_no_writeback instead
of the nop .set_page_dirty, and dropped the SetPageDirty (don't manually
set the dirty flags, don't disable set_page_dirty(), rely on default behaviour).

With the above change, the dirty pages accounting can work well. But as we
known, aio fs is an anonymous one, which should never cause any real write-back,
we can ignore the dirty pages (write back) accounting by disabling the dirty
pages (write back) accounting capability. So we introduce an aio private
backing dev info (disabled the ACCT_DIRTY/WRITEBACK/ACCT_WB capabilities) to
replace the default one.

Reported-by: Markus Königshaus &lt;m.koenigshaus@wut.de&gt;
Signed-off-by: Gu Zheng &lt;guz.fnst@cn.fujitsu.com&gt;
Acked-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Benjamin LaHaise &lt;bcrl@kvack.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/jfs/jfs_inode.c: atomically set inode-&gt;i_flags</title>
<updated>2014-12-03T10:58:43+00:00</updated>
<author>
<name>Fabian Frederick</name>
<email>fabf@skynet.be</email>
</author>
<published>2014-04-14T07:39:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=7e3bea443c47e2f499d7547dbabafbaacfa2f8e6'/>
<id>7e3bea443c47e2f499d7547dbabafbaacfa2f8e6</id>
<content type='text'>
commit 24e4a0f3de21ad715c9235367e241554c64b9adb upstream.

According to commit 5f16f3225b0624

ext4: atomically set inode-&gt;i_flags in ext4_set_inode_flags()

Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Signed-off-by: Dave Kleikamp &lt;dave.kleikamp@oracle.com&gt;
Cc: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 24e4a0f3de21ad715c9235367e241554c64b9adb upstream.

According to commit 5f16f3225b0624

ext4: atomically set inode-&gt;i_flags in ext4_set_inode_flags()

Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Signed-off-by: Dave Kleikamp &lt;dave.kleikamp@oracle.com&gt;
Cc: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ext4: atomically set inode-&gt;i_flags in ext4_set_inode_flags()</title>
<updated>2014-12-03T10:58:43+00:00</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2014-03-24T18:43:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ec81c28104fd2198f076203be3d1bae5546e863f'/>
<id>ec81c28104fd2198f076203be3d1bae5546e863f</id>
<content type='text'>
commit 5f16f3225b06242a9ee876f07c1c9b6ed36a22b6 upstream.

Use cmpxchg() to atomically set i_flags instead of clearing out the
S_IMMUTABLE, S_APPEND, etc. flags and then setting them from the
EXT4_IMMUTABLE_FL, EXT4_APPEND_FL flags, since this opens up a race
where an immutable file has the immutable flag cleared for a brief
window of time.

js: there is no change for ext4. This patch defines merely
    inode_set_flags for jffs in the next patch. I wonder why do we
    have both inode_set_flags and set_mask_bits? Looks like an
    improperly resolved merge conflict.

Reported-by: John Sullivan &lt;jsrhbz@kanargh.force9.co.uk&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: stable@kernel.org
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 5f16f3225b06242a9ee876f07c1c9b6ed36a22b6 upstream.

Use cmpxchg() to atomically set i_flags instead of clearing out the
S_IMMUTABLE, S_APPEND, etc. flags and then setting them from the
EXT4_IMMUTABLE_FL, EXT4_APPEND_FL flags, since this opens up a race
where an immutable file has the immutable flag cleared for a brief
window of time.

js: there is no change for ext4. This patch defines merely
    inode_set_flags for jffs in the next patch. I wonder why do we
    have both inode_set_flags and set_mask_bits? Looks like an
    improperly resolved merge conflict.

Reported-by: John Sullivan &lt;jsrhbz@kanargh.force9.co.uk&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: stable@kernel.org
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>minix zmap block counts calculation fix</title>
<updated>2014-12-03T10:58:43+00:00</updated>
<author>
<name>Qi Yong</name>
<email>qiyong@fc-cn.com</email>
</author>
<published>2014-08-08T21:20:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=692f067fb661c39cc800ae7407ab655173ca2de2'/>
<id>692f067fb661c39cc800ae7407ab655173ca2de2</id>
<content type='text'>
commit 6d6747f85314687f72012ae85cde401db531e130 upstream.

The original minix zmap blocks calculation was correct, in the formula of:

	sbi-&gt;s_nzones - sbi-&gt;s_firstdatazone + 1

It is

	sp-&gt;s_zones - (sp-&gt;s_firstdatazone - 1)

in the minix3 source code.

But a later commit 016e8d44bc06 ("fs/minix: Verify bitmap block counts
before mounting") has changed it unfortunately as:

  sbi-&gt;s_nzones - (sbi-&gt;s_firstdatazone + 1)

This would show free blocks one block less than the real when the total
data blocks are in "full zmap blocks plus one".

This patch corrects that zmap blocks calculation and tidy a printk
message while at it.

Signed-off-by: Qi Yong &lt;qiyong@fc-cn.com&gt;
Cc: Josh Boyer &lt;jwboyer@redhat.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 6d6747f85314687f72012ae85cde401db531e130 upstream.

The original minix zmap blocks calculation was correct, in the formula of:

	sbi-&gt;s_nzones - sbi-&gt;s_firstdatazone + 1

It is

	sp-&gt;s_zones - (sp-&gt;s_firstdatazone - 1)

in the minix3 source code.

But a later commit 016e8d44bc06 ("fs/minix: Verify bitmap block counts
before mounting") has changed it unfortunately as:

  sbi-&gt;s_nzones - (sbi-&gt;s_firstdatazone + 1)

This would show free blocks one block less than the real when the total
data blocks are in "full zmap blocks plus one".

This patch corrects that zmap blocks calculation and tidy a printk
message while at it.

Signed-off-by: Qi Yong &lt;qiyong@fc-cn.com&gt;
Cc: Josh Boyer &lt;jwboyer@redhat.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nilfs2: add missing blkdev_issue_flush() to nilfs_sync_fs()</title>
<updated>2014-12-03T10:58:42+00:00</updated>
<author>
<name>Andreas Rohner</name>
<email>andreas.rohner@gmx.net</email>
</author>
<published>2014-10-13T22:53:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0d68992fb4250d00a906ee886ec541a6afeab066'/>
<id>0d68992fb4250d00a906ee886ec541a6afeab066</id>
<content type='text'>
commit e2c7617ae36b27f97643bfa08aabe27e630c1a76 upstream.

Under normal circumstances nilfs_sync_fs() writes out the super block,
which causes a flush of the underlying block device.  But this depends
on the THE_NILFS_SB_DIRTY flag, which is only set if the pointer to the
last segment crosses a segment boundary.  So if only a small amount of
data is written before the call to nilfs_sync_fs(), no flush of the
block device occurs.

In the above case an additional call to blkdev_issue_flush() is needed.
To prevent unnecessary overhead, the new flag nilfs-&gt;ns_flushed_device
is introduced, which is cleared whenever new logs are written and set
whenever the block device is flushed.  For convenience the function
nilfs_flush_device() is added, which contains the above logic.

Signed-off-by: Andreas Rohner &lt;andreas.rohner@gmx.net&gt;
Signed-off-by: Ryusuke Konishi &lt;konishi.ryusuke@lab.ntt.co.jp&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit e2c7617ae36b27f97643bfa08aabe27e630c1a76 upstream.

Under normal circumstances nilfs_sync_fs() writes out the super block,
which causes a flush of the underlying block device.  But this depends
on the THE_NILFS_SB_DIRTY flag, which is only set if the pointer to the
last segment crosses a segment boundary.  So if only a small amount of
data is written before the call to nilfs_sync_fs(), no flush of the
block device occurs.

In the above case an additional call to blkdev_issue_flush() is needed.
To prevent unnecessary overhead, the new flag nilfs-&gt;ns_flushed_device
is introduced, which is cleared whenever new logs are written and set
whenever the block device is flushed.  For convenience the function
nilfs_flush_device() is added, which contains the above logic.

Signed-off-by: Andreas Rohner &lt;andreas.rohner@gmx.net&gt;
Signed-off-by: Ryusuke Konishi &lt;konishi.ryusuke@lab.ntt.co.jp&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fix O_SYNC|O_APPEND syncing the wrong range on write()</title>
<updated>2014-12-03T10:58:41+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2014-02-09T20:18:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=79a423edd0ce526b6a28fd1fed4478d0ecda03e0'/>
<id>79a423edd0ce526b6a28fd1fed4478d0ecda03e0</id>
<content type='text'>
commit d311d79de305f1ada47cadd672e6ed1b28a949eb upstream.

It actually goes back to 2004 ([PATCH] Concurrent O_SYNC write support)
when sync_page_range() had been introduced; generic_file_write{,v}() correctly
synced
	pos_after_write - written .. pos_after_write - 1
but generic_file_aio_write() synced
	pos_before_write .. pos_before_write + written - 1
instead.  Which is not the same thing with O_APPEND, obviously.
A couple of years later correct variant had been killed off when
everything switched to use of generic_file_aio_write().

All users of generic_file_aio_write() are affected, and the same bug
has been copied into other instances of -&gt;aio_write().

The fix is trivial; the only subtle point is that generic_write_sync()
ought to be inlined to avoid calculations useless for the majority of
calls.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit d311d79de305f1ada47cadd672e6ed1b28a949eb upstream.

It actually goes back to 2004 ([PATCH] Concurrent O_SYNC write support)
when sync_page_range() had been introduced; generic_file_write{,v}() correctly
synced
	pos_after_write - written .. pos_after_write - 1
but generic_file_aio_write() synced
	pos_before_write .. pos_before_write + written - 1
instead.  Which is not the same thing with O_APPEND, obviously.
A couple of years later correct variant had been killed off when
everything switched to use of generic_file_aio_write().

All users of generic_file_aio_write() are affected, and the same bug
has been copied into other instances of -&gt;aio_write().

The fix is trivial; the only subtle point is that generic_write_sync()
ought to be inlined to avoid calculations useless for the majority of
calls.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hfsplus: emit proper file type from readdir</title>
<updated>2014-11-19T22:44:32+00:00</updated>
<author>
<name>Sergei Antonov</name>
<email>saproj@gmail.com</email>
</author>
<published>2014-06-06T21:36:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f96abf0060149fbc2093c2de7f4dae9fbff20694'/>
<id>f96abf0060149fbc2093c2de7f4dae9fbff20694</id>
<content type='text'>
commit 97a62eaefdc196969e9d3857f65fc8a90ee1fe3c upstream.

hfsplus_readdir() incorrectly returned DT_REG for symbolic links and
special files.  Return DT_REG, DT_LNK, DT_FIFO, DT_CHR, DT_BLK, DT_SOCK,
or DT_UNKNOWN according to mode field in catalog record.  Programs
relying on information from readdir will now work correctly with HFS+.

Signed-off-by: Sergei Antonov &lt;saproj@gmail.com&gt;
Cc: Anton Altaparmakov &lt;aia21@cam.ac.uk&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: Vyacheslav Dubeyko &lt;slava@dubeyko.com&gt;
Cc: Hin-Tak Leung &lt;htl10@users.sourceforge.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 97a62eaefdc196969e9d3857f65fc8a90ee1fe3c upstream.

hfsplus_readdir() incorrectly returned DT_REG for symbolic links and
special files.  Return DT_REG, DT_LNK, DT_FIFO, DT_CHR, DT_BLK, DT_SOCK,
or DT_UNKNOWN according to mode field in catalog record.  Programs
relying on information from readdir will now work correctly with HFS+.

Signed-off-by: Sergei Antonov &lt;saproj@gmail.com&gt;
Cc: Anton Altaparmakov &lt;aia21@cam.ac.uk&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: Vyacheslav Dubeyko &lt;slava@dubeyko.com&gt;
Cc: Hin-Tak Leung &lt;htl10@users.sourceforge.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</pre>
</div>
</content>
</entry>
</feed>
