<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs, branch v4.8</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.8</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-09-30T22:26:52Z</updated>
<entry>
<title>ocfs2: fix deadlock on mmapped page in ocfs2_write_begin_nolock()</title>
<updated>2016-09-30T22:26:52Z</updated>
<author>
<name>Eric Ren</name>
<email>zren@suse.com</email>
</author>
<published>2016-09-30T22:11:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c33f0785bf292cf1d15f4fbe42869c63e205b21c'/>
<id>urn:sha1:c33f0785bf292cf1d15f4fbe42869c63e205b21c</id>
<content type='text'>
The testcase "mmaptruncate" of ocfs2-test deadlocks occasionally.

In this testcase, we create a 2*CLUSTER_SIZE file and mmap() on it;
there are 2 process repeatedly performing the following operations
respectively: one is doing memset(mmaped_addr + 2*CLUSTER_SIZE - 1, 'a',
1), while the another is playing ftruncate(fd, 2*CLUSTER_SIZE) and then
ftruncate(fd, CLUSTER_SIZE) again and again.

This is the backtrace when the deadlock happens:

   __wait_on_bit_lock+0x50/0xa0
   __lock_page+0xb7/0xc0
   ocfs2_write_begin_nolock+0x163f/0x1790 [ocfs2]
   ocfs2_page_mkwrite+0x1c7/0x2a0 [ocfs2]
   do_page_mkwrite+0x66/0xc0
   handle_mm_fault+0x685/0x1350
   __do_page_fault+0x1d8/0x4d0
   trace_do_page_fault+0x37/0xf0
   do_async_page_fault+0x19/0x70
   async_page_fault+0x28/0x30

In ocfs2_write_begin_nolock(), we first grab the pages and then allocate
disk space for this write; ocfs2_try_to_free_truncate_log() will be
called if -ENOSPC is returned; if we're lucky to get enough clusters,
which is usually the case, we start over again.

But in ocfs2_free_write_ctxt() the target page isn't unlocked, so we
will deadlock when trying to grab the target page again.

Also, -ENOMEM might be returned in ocfs2_grab_pages_for_write().
Another deadlock will happen in __do_page_mkwrite() if
ocfs2_page_mkwrite() returns non-VM_FAULT_LOCKED, and along with a
locked target page.

These two errors fail on the same path, so fix them by unlocking the
target page manually before ocfs2_free_write_ctxt().

Jan Kara helps me clear out the JBD2 part, and suggest the hint for root
cause.

Changes since v1:
1. Also put ENOMEM error case into consideration.

Link: http://lkml.kernel.org/r/1474173902-32075-1-git-send-email-zren@suse.com
Signed-off-by: Eric Ren &lt;zren@suse.com&gt;
Reviewed-by: He Gang &lt;ghe@suse.com&gt;
Acked-by: Joseph Qi &lt;joseph.qi@huawei.com&gt;
Cc: Mark Fasheh &lt;mfasheh@suse.de&gt;
Cc: Joel Becker &lt;jlbec@evilplan.org&gt;
Cc: Junxiao Bi &lt;junxiao.bi@oracle.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>Merge branch 'for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs</title>
<updated>2016-09-23T20:39:37Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-09-23T20:39:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b22734a55067adbc10216e459762dbd7dcef29d5'/>
<id>urn:sha1:b22734a55067adbc10216e459762dbd7dcef29d5</id>
<content type='text'>
Pull btrfs fixes from Chris Mason:
 "Josef fixed a problem when quotas are enabled with his latest ENOSPC
  rework, and Jeff added more checks into the subvol ioctls to avoid
  tripping up lookup_one_len"

* 'for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  btrfs: ensure that file descriptor used with subvol ioctls is a dir
  Btrfs: handle quota reserve failure properly
</content>
</entry>
<entry>
<title>Merge tag 'configfs-for-4.8-2' of git://git.infradead.org/users/hch/configfs</title>
<updated>2016-09-23T16:45:15Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-09-23T16:45:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e47f2e50ead9dd9eb10b2626d739760e71ce6d43'/>
<id>urn:sha1:e47f2e50ead9dd9eb10b2626d739760e71ce6d43</id>
<content type='text'>
Pull configfs fix from Christoph Hellwig:
 "One more trivial fix for the binary attribute code from Phil Turnbull"

* tag 'configfs-for-4.8-2' of git://git.infradead.org/users/hch/configfs:
  configfs: Return -EFBIG from configfs_write_bin_file.
</content>
</entry>
<entry>
<title>btrfs: ensure that file descriptor used with subvol ioctls is a dir</title>
<updated>2016-09-22T00:22:16Z</updated>
<author>
<name>Jeff Mahoney</name>
<email>jeffm@suse.com</email>
</author>
<published>2016-09-21T12:31:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=325c50e3cebb9208009083e841550f98a863bfa0'/>
<id>urn:sha1:325c50e3cebb9208009083e841550f98a863bfa0</id>
<content type='text'>
If the subvol/snapshot create/destroy ioctls are passed a regular file
with execute permissions set, we'll eventually Oops while trying to do
inode-&gt;i_op-&gt;lookup via lookup_one_len.

This patch ensures that the file descriptor refers to a directory.

Fixes: cb8e70901d (Btrfs: Fix subvolume creation locking rules)
Fixes: 76dda93c6a (Btrfs: add snapshot/subvolume destroy ioctl)
Cc: &lt;stable@vger.kernel.org&gt; #v2.6.29+
Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: handle quota reserve failure properly</title>
<updated>2016-09-22T00:22:16Z</updated>
<author>
<name>Josef Bacik</name>
<email>jbacik@fb.com</email>
</author>
<published>2016-09-15T18:57:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1e5ec2e709bd8c5588fdbdda909945e4e2be8d23'/>
<id>urn:sha1:1e5ec2e709bd8c5588fdbdda909945e4e2be8d23</id>
<content type='text'>
btrfs/022 was spitting a warning for the case that we exceed the quota.  If we
fail to make our quota reservation we need to clean up our data space
reservation.  Thanks,

Signed-off-by: Josef Bacik &lt;jbacik@fb.com&gt;
Tested-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Signed-off-by: Chris Mason &lt;clm@fb.com&gt;
</content>
</entry>
<entry>
<title>fs/proc/kcore.c: Add bounce buffer for ktext data</title>
<updated>2016-09-20T20:32:49Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@kernel.org</email>
</author>
<published>2016-09-08T07:57:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=df04abfd181acc276ba6762c8206891ae10ae00d'/>
<id>urn:sha1:df04abfd181acc276ba6762c8206891ae10ae00d</id>
<content type='text'>
We hit hardened usercopy feature check for kernel text access by reading
kcore file:

  usercopy: kernel memory exposure attempt detected from ffffffff8179a01f (&lt;kernel text&gt;) (4065 bytes)
  kernel BUG at mm/usercopy.c:75!

Bypassing this check for kcore by adding bounce buffer for ktext data.

Reported-by: Steve Best &lt;sbest@redhat.com&gt;
Fixes: f5509cc18daa ("mm: Hardened usercopy")
Suggested-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Acked-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fs/proc/kcore.c: Make bounce buffer global for read</title>
<updated>2016-09-20T20:32:49Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@kernel.org</email>
</author>
<published>2016-09-08T07:57:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f5beeb1851ea6f8cfcf2657f26cb24c0582b4945'/>
<id>urn:sha1:f5beeb1851ea6f8cfcf2657f26cb24c0582b4945</id>
<content type='text'>
Next patch adds bounce buffer for ktext area, so it's
convenient to have single bounce buffer for both
vmalloc/module and ktext cases.

Suggested-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Acked-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "ocfs2: bump up o2cb network protocol version"</title>
<updated>2016-09-19T22:36:17Z</updated>
<author>
<name>Junxiao Bi</name>
<email>junxiao.bi@oracle.com</email>
</author>
<published>2016-09-19T21:44:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=63b52c4936a2e679639c38ef51a50aa8ca1c5c07'/>
<id>urn:sha1:63b52c4936a2e679639c38ef51a50aa8ca1c5c07</id>
<content type='text'>
This reverts commit 38b52efd218b ("ocfs2: bump up o2cb network protocol
version").

This commit made rolling upgrade fail.  When one node is upgraded to new
version with this commit, the remaining nodes will fail to establish
connections to it, then the application like VMs on the remaining nodes
can't be live migrated to the upgraded one.  This will cause an outage.
Since negotiate hb timeout behavior didn't change without this commit,
so revert it.

Fixes: 38b52efd218bf ("ocfs2: bump up o2cb network protocol version")
Link: http://lkml.kernel.org/r/1471396924-10375-1-git-send-email-junxiao.bi@oracle.com
Signed-off-by: Junxiao Bi &lt;junxiao.bi@oracle.com&gt;
Cc: Mark Fasheh &lt;mfasheh@suse.de&gt;
Cc: Joel Becker &lt;jlbec@evilplan.org&gt;
Cc: Joseph Qi &lt;joseph.qi@huawei.com&gt;
Cc: &lt;stable@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>ocfs2: fix start offset to ocfs2_zero_range_for_truncate()</title>
<updated>2016-09-19T22:36:17Z</updated>
<author>
<name>Ashish Samant</name>
<email>ashish.samant@oracle.com</email>
</author>
<published>2016-09-19T21:44:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d21c353d5e99c56cdd5b5c1183ffbcaf23b8b960'/>
<id>urn:sha1:d21c353d5e99c56cdd5b5c1183ffbcaf23b8b960</id>
<content type='text'>
If we punch a hole on a reflink such that following conditions are met:

1. start offset is on a cluster boundary
2. end offset is not on a cluster boundary
3. (end offset is somewhere in another extent) or
   (hole range &gt; MAX_CONTIG_BYTES(1MB)),

we dont COW the first cluster starting at the start offset.  But in this
case, we were wrongly passing this cluster to
ocfs2_zero_range_for_truncate() to zero out.  This will modify the
cluster in place and zero it in the source too.

Fix this by skipping this cluster in such a scenario.

To reproduce:

1. Create a random file of say 10 MB
     xfs_io -c 'pwrite -b 4k 0 10M' -f 10MBfile
2. Reflink  it
     reflink -f 10MBfile reflnktest
3. Punch a hole at starting at cluster boundary  with range greater that
1MB. You can also use a range that will put the end offset in another
extent.
     fallocate -p -o 0 -l 1048615 reflnktest
4. sync
5. Check the  first cluster in the source file. (It will be zeroed out).
    dd if=10MBfile iflag=direct bs=&lt;cluster size&gt; count=1 | hexdump -C

Link: http://lkml.kernel.org/r/1470957147-14185-1-git-send-email-ashish.samant@oracle.com
Signed-off-by: Ashish Samant &lt;ashish.samant@oracle.com&gt;
Reported-by: Saar Maoz &lt;saar.maoz@oracle.com&gt;
Reviewed-by: Srinivas Eeda &lt;srinivas.eeda@oracle.com&gt;
Cc: Mark Fasheh &lt;mfasheh@suse.de&gt;
Cc: Joel Becker &lt;jlbec@evilplan.org&gt;
Cc: Junxiao Bi &lt;junxiao.bi@oracle.com&gt;
Cc: Joseph Qi &lt;joseph.qi@huawei.com&gt;
Cc: Eric Ren &lt;zren@suse.com&gt;
Cc: &lt;stable@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>ocfs2: fix double unlock in case retry after free truncate log</title>
<updated>2016-09-19T22:36:17Z</updated>
<author>
<name>Joseph Qi</name>
<email>joseph.qi@huawei.com</email>
</author>
<published>2016-09-19T21:44:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3bb8b653c86f6b1d2cc05aa1744fed4b18f99485'/>
<id>urn:sha1:3bb8b653c86f6b1d2cc05aa1744fed4b18f99485</id>
<content type='text'>
If ocfs2_reserve_cluster_bitmap_bits() fails with ENOSPC, it will try to
free truncate log and then retry.  Since ocfs2_try_to_free_truncate_log
will lock/unlock global bitmap inode, we have to unlock it before
calling this function.  But when retry reserve and it fails with no
global bitmap inode lock taken, it will unlock again in error handling
branch and BUG.

This issue also exists if no need retry and then ocfs2_inode_lock fails.
So fix it.

Fixes: 2070ad1aebff ("ocfs2: retry on ENOSPC if sufficient space in truncate log")
Link: http://lkml.kernel.org/r/57D91939.6030809@huawei.com
Signed-off-by: Joseph Qi &lt;joseph.qi@huawei.com&gt;
Signed-off-by: Jiufei Xue &lt;xuejiufei@huawei.com&gt;
Cc: Mark Fasheh &lt;mfasheh@suse.de&gt;
Cc: Joel Becker &lt;jlbec@evilplan.org&gt;
Cc: Junxiao Bi &lt;junxiao.bi@oracle.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>
