<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/fs/nfs, branch v4.1.12</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v4.1.12</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v4.1.12'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2015-10-27T00:52:00+00:00</updated>
<entry>
<title>nfs4: have do_vfs_lock take an inode pointer</title>
<updated>2015-10-27T00:52:00+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jeff.layton@primarydata.com</email>
</author>
<published>2015-07-11T10:43:03+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=41c4e0825b9d43a5d43a90c050ac9de4387865ba'/>
<id>urn:sha1:41c4e0825b9d43a5d43a90c050ac9de4387865ba</id>
<content type='text'>
commit 83bfff23e9ed19f37c4ef0bba84e75bd88e5cf21 upstream.

Now that we have file locking helpers that can deal with an inode
instead of a filp, we can change the NFSv4 locking code to use that
instead.

This should fix the case where we have a filp that is closed while flock
or OFD locks are set on it, and the task is signaled so that it doesn't
wait for the LOCKU reply to come in before the filp is freed. At that
point we can end up with a use-after-free with the current code, which
relies on dereferencing the fl_file in the lock request.

Signed-off-by: Jeff Layton &lt;jeff.layton@primarydata.com&gt;
Reviewed-by: "J. Bruce Fields" &lt;bfields@fieldses.org&gt;
Tested-by: "J. Bruce Fields" &lt;bfields@fieldses.org&gt;
Cc: William Dauchy &lt;william@gandi.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>nfs/filelayout: Fix NULL reference caused by double freeing of fh_array</title>
<updated>2015-10-22T21:43:26+00:00</updated>
<author>
<name>Kinglong Mee</name>
<email>kinglongmee@gmail.com</email>
</author>
<published>2015-09-14T12:12:21+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=863e9b4f5ab7e6c7230b289397b06ca4c77a671d'/>
<id>urn:sha1:863e9b4f5ab7e6c7230b289397b06ca4c77a671d</id>
<content type='text'>
commit 3ec0c97959abff33a42db9081c22132bcff5b4f2 upstream.

If filelayout_decode_layout fail, _filelayout_free_lseg will causes
a double freeing of fh_array.

[ 1179.279800] BUG: unable to handle kernel NULL pointer dereference at           (null)
[ 1179.280198] IP: [&lt;ffffffffa027222d&gt;] filelayout_free_fh_array.isra.11+0x1d/0x70 [nfs_layout_nfsv41_files]
[ 1179.281010] PGD 0
[ 1179.281443] Oops: 0000 [#1]
[ 1179.281831] Modules linked in: nfs_layout_nfsv41_files(OE) nfsv4(OE) nfs(OE) fscache(E) xfs libcrc32c coretemp nfsd crct10dif_pclmul ppdev crc32_pclmul crc32c_intel auth_rpcgss ghash_clmulni_intel nfs_acl lockd vmw_balloon grace sunrpc parport_pc vmw_vmci parport shpchp i2c_piix4 vmwgfx drm_kms_helper ttm drm serio_raw mptspi scsi_transport_spi mptscsih e1000 mptbase ata_generic pata_acpi [last unloaded: fscache]
[ 1179.283891] CPU: 0 PID: 13336 Comm: cat Tainted: G           OE   4.3.0-rc1-pnfs+ #244
[ 1179.284323] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 05/20/2014
[ 1179.285206] task: ffff8800501d48c0 ti: ffff88003e3c4000 task.ti: ffff88003e3c4000
[ 1179.285668] RIP: 0010:[&lt;ffffffffa027222d&gt;]  [&lt;ffffffffa027222d&gt;] filelayout_free_fh_array.isra.11+0x1d/0x70 [nfs_layout_nfsv41_files]
[ 1179.286612] RSP: 0018:ffff88003e3c77f8  EFLAGS: 00010202
[ 1179.287092] RAX: 0000000000000000 RBX: ffff88001fe78900 RCX: 0000000000000000
[ 1179.287731] RDX: ffffea0000f40760 RSI: ffff88001fe789c8 RDI: ffff88001fe789c0
[ 1179.288383] RBP: ffff88003e3c7810 R08: ffffea0000f40760 R09: 0000000000000000
[ 1179.289170] R10: 0000000000000000 R11: 0000000000000001 R12: ffff88001fe789c8
[ 1179.289959] R13: ffff88001fe789c0 R14: ffff88004ec05a80 R15: ffff88004f935b88
[ 1179.290791] FS:  00007f4e66bb5700(0000) GS:ffffffff81c29000(0000) knlGS:0000000000000000
[ 1179.291580] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1179.292209] CR2: 0000000000000000 CR3: 00000000203f8000 CR4: 00000000001406f0
[ 1179.292731] Stack:
[ 1179.293195]  ffff88001fe78900 00000000000000d0 ffff88001fe78178 ffff88003e3c7868
[ 1179.293676]  ffffffffa0272737 0000000000000001 0000000000000001 ffff88001fe78800
[ 1179.294151]  00000000614fffce ffffffff81727671 ffff88001fe78100 ffff88001fe78100
[ 1179.294623] Call Trace:
[ 1179.295092]  [&lt;ffffffffa0272737&gt;] filelayout_alloc_lseg+0xa7/0x2d0 [nfs_layout_nfsv41_files]
[ 1179.295625]  [&lt;ffffffff81727671&gt;] ? out_of_line_wait_on_bit+0x81/0xb0
[ 1179.296133]  [&lt;ffffffffa040407e&gt;] pnfs_layout_process+0xae/0x320 [nfsv4]
[ 1179.296632]  [&lt;ffffffffa03e0a01&gt;] nfs4_proc_layoutget+0x2b1/0x360 [nfsv4]
[ 1179.297134]  [&lt;ffffffffa0402983&gt;] pnfs_update_layout+0x853/0xb30 [nfsv4]
[ 1179.297632]  [&lt;ffffffffa039db24&gt;] ? nfs_get_lock_context+0x74/0x170 [nfs]
[ 1179.298158]  [&lt;ffffffffa0271807&gt;] filelayout_pg_init_read+0x37/0x50 [nfs_layout_nfsv41_files]
[ 1179.298834]  [&lt;ffffffffa03a72d9&gt;] __nfs_pageio_add_request+0x119/0x460 [nfs]
[ 1179.299385]  [&lt;ffffffffa03a6bd7&gt;] ? nfs_create_request.part.9+0x37/0x2e0 [nfs]
[ 1179.299872]  [&lt;ffffffffa03a7cc3&gt;] nfs_pageio_add_request+0xa3/0x1b0 [nfs]
[ 1179.300362]  [&lt;ffffffffa03a8635&gt;] readpage_async_filler+0x85/0x260 [nfs]
[ 1179.300907]  [&lt;ffffffff81180cb1&gt;] read_cache_pages+0x91/0xd0
[ 1179.301391]  [&lt;ffffffffa03a85b0&gt;] ? nfs_read_completion+0x220/0x220 [nfs]
[ 1179.301867]  [&lt;ffffffffa03a8dc8&gt;] nfs_readpages+0x128/0x200 [nfs]
[ 1179.302330]  [&lt;ffffffff81180ef3&gt;] __do_page_cache_readahead+0x203/0x280
[ 1179.302784]  [&lt;ffffffff81180dc8&gt;] ? __do_page_cache_readahead+0xd8/0x280
[ 1179.303413]  [&lt;ffffffff81181116&gt;] ondemand_readahead+0x1a6/0x2f0
[ 1179.303855]  [&lt;ffffffff81181371&gt;] page_cache_sync_readahead+0x31/0x50
[ 1179.304286]  [&lt;ffffffff811750a6&gt;] generic_file_read_iter+0x4a6/0x5c0
[ 1179.304711]  [&lt;ffffffffa03a0316&gt;] ? __nfs_revalidate_mapping+0x1f6/0x240 [nfs]
[ 1179.305132]  [&lt;ffffffffa039ccf2&gt;] nfs_file_read+0x52/0xa0 [nfs]
[ 1179.305540]  [&lt;ffffffff811e343c&gt;] __vfs_read+0xcc/0x100
[ 1179.305936]  [&lt;ffffffff811e3d15&gt;] vfs_read+0x85/0x130
[ 1179.306326]  [&lt;ffffffff811e4a98&gt;] SyS_read+0x58/0xd0
[ 1179.306708]  [&lt;ffffffff8172caaf&gt;] entry_SYSCALL_64_fastpath+0x12/0x76
[ 1179.307094] Code: c4 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 89 e5 41 55 41 54 53 8b 07 49 89 f4 85 c0 74 47 48 8b 06 49 89 fd &lt;48&gt; 8b 38 48 85 ff 74 22 31 db eb 0c 48 63 d3 48 8b 3c d0 48 85
[ 1179.308357] RIP  [&lt;ffffffffa027222d&gt;] filelayout_free_fh_array.isra.11+0x1d/0x70 [nfs_layout_nfsv41_files]
[ 1179.309177]  RSP &lt;ffff88003e3c77f8&gt;
[ 1179.309582] CR2: 0000000000000000

Signed-off-by: Kinglong Mee &lt;kinglongmee@gmail.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Cc: William Dauchy &lt;william@gandi.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>NFS: Fix a write performance regression</title>
<updated>2015-10-22T21:43:18+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@primarydata.com</email>
</author>
<published>2015-10-01T22:38:27+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=896f0858ce91e3207ea5bd59abc23fb58b2c159a'/>
<id>urn:sha1:896f0858ce91e3207ea5bd59abc23fb58b2c159a</id>
<content type='text'>
commit 8fa4592a14ebb3c22a21d846d1e4f65dab7d1a7c upstream.

If all other conditions in nfs_can_extend_write() are met, and there
are no locks, then we should be able to assume close-to-open semantics
and the ability to extend our write to cover the whole page.

With this patch, the xfstests generic/074 test completes in 242s instead
of &gt;1400s on my test rig.

Fixes: bd61e0a9c852 ("locks: convert posix locks to file_lock_context")
Cc: Jeff Layton &lt;jlayton@primarydata.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>nfs: fix pg_test page count calculation</title>
<updated>2015-10-22T21:43:18+00:00</updated>
<author>
<name>Peng Tao</name>
<email>tao.peng@primarydata.com</email>
</author>
<published>2015-09-11T03:14:06+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=0fe83960ecd61b82fb436728712330b61b47d53a'/>
<id>urn:sha1:0fe83960ecd61b82fb436728712330b61b47d53a</id>
<content type='text'>
commit 048883e0b934d9a5103d40e209cb14b7f33d2933 upstream.

We really want sizeof(struct page *) instead. Otherwise we limit
maximum IO size to 64 pages rather than 512 pages on a 64bit system.

Fixes 2e11f829(nfs: cap request size to fit a kmalloced page array).

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Peng Tao &lt;tao.peng@primarydata.com&gt;
Fixes: 2e11f8296d22 ("nfs: cap request size to fit a kmalloced page array")
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>NFS: Do cleanup before resetting pageio read/write to mds</title>
<updated>2015-10-22T21:43:18+00:00</updated>
<author>
<name>Kinglong Mee</name>
<email>kinglongmee@gmail.com</email>
</author>
<published>2015-09-20T15:03:28+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=953c972242a0772d938b391bc9d70b3c0591c20f'/>
<id>urn:sha1:953c972242a0772d938b391bc9d70b3c0591c20f</id>
<content type='text'>
commit 6f29b9bba7b08c6b1d6f2cc4cf750b342fc1946c upstream.

There is a reference leak of layout segment after resetting
pageio read/write to mds.

Signed-off-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>Revert "NFSv4: Remove incorrect check in can_open_delegated()"</title>
<updated>2015-09-29T17:26:10+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@primarydata.com</email>
</author>
<published>2015-08-19T05:14:20+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=d40d9de9d3533ef6607342ec153b426b9d2b892e'/>
<id>urn:sha1:d40d9de9d3533ef6607342ec153b426b9d2b892e</id>
<content type='text'>
commit 36319608e28701c07cad80ae3be8b0fdfb1ab40f upstream.

This reverts commit 4e379d36c050b0117b5d10048be63a44f5036115.

This commit opens up a race between the recovery code and the open code.

Reported-by: Olga Kornievskaia &lt;aglo@umich.edu&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>NFSv4.1: Fix a protocol issue with CLOSE stateids</title>
<updated>2015-09-29T17:26:10+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@primarydata.com</email>
</author>
<published>2015-08-31T01:37:59+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=3d5c6b90ed90eadcd9c66951877697d848e63ac1'/>
<id>urn:sha1:3d5c6b90ed90eadcd9c66951877697d848e63ac1</id>
<content type='text'>
commit 4a1e2feb9d246775dee0f78ed5b18826bae2b1c5 upstream.

According to RFC5661 Section 18.2.4, CLOSE is supposed to return
the zero stateid. This means that nfs_clear_open_stateid_locked()
cannot assume that the result stateid will always match the 'other'
field of the existing open stateid when trying to determine a race
with a parallel OPEN.

Instead, we look at the argument, and check for matches.

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>NFSv4.1/flexfiles: Fix a protocol error in layoutreturn</title>
<updated>2015-09-29T17:26:10+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@primarydata.com</email>
</author>
<published>2015-08-28T00:37:39+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f6384199b2592674c7e6cfcfb4c0c54eacf992d7'/>
<id>urn:sha1:f6384199b2592674c7e6cfcfb4c0c54eacf992d7</id>
<content type='text'>
commit d13549074cf066d6d5bb29903d044beffea342d3 upstream.

According to the flexfiles protocol, the layoutreturn should specify an
array of errors in the following format:

struct ff_ioerr4 {
	offset4        ffie_offset;
	length4        ffie_length;
	stateid4       ffie_stateid;
	device_error4  ffie_errors&lt;&gt;;
};

This patch fixes up the code to ensure that our ffie_errors is indeed
encoded as an array (albeit with only a single entry).

Reported-by: Tom Haynes &lt;thomas.haynes@primarydata.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>NFS41/flexfiles: zero out DS write wcc</title>
<updated>2015-09-29T17:26:10+00:00</updated>
<author>
<name>Peng Tao</name>
<email>tao.peng@primarydata.com</email>
</author>
<published>2015-08-21T22:40:00+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=b5a6dec79b2764584e5d5105f3f49bc58bf99513'/>
<id>urn:sha1:b5a6dec79b2764584e5d5105f3f49bc58bf99513</id>
<content type='text'>
commit 5420401079e152ff68a8024f6a375804b1c21505 upstream.

We do not want to update inode attributes with DS values.

Signed-off-by: Peng Tao &lt;tao.peng@primarydata.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>NFSv4: Force a post-op attribute update when holding a delegation</title>
<updated>2015-09-29T17:26:09+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>trond.myklebust@primarydata.com</email>
</author>
<published>2015-08-20T23:56:07+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=66bfdda4b2042bca88b429a55ca010d5ab94f991'/>
<id>urn:sha1:66bfdda4b2042bca88b429a55ca010d5ab94f991</id>
<content type='text'>
commit aaae3f00d3f67f681a1f3cb7af999e976e8a24ce upstream.

If the ctime or mtime or change attribute have changed because
of an operation we initiated, we should make sure that we force
an attribute update. However we do not want to mark the page cache
for revalidation.

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

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