<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/nfs/direct.c, branch linux-4.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-07-31T14:43:12Z</updated>
<entry>
<title>SUNRPC reverting d03727b248d0 ("NFSv4 fix CLOSE not waiting for direct IO compeletion")</title>
<updated>2020-07-31T14:43:12Z</updated>
<author>
<name>Olga Kornievskaia</name>
</author>
<published>2020-07-15T17:04:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=81475c5dbd61ceb2af63b4b3a1a82851082c2768'/>
<id>urn:sha1:81475c5dbd61ceb2af63b4b3a1a82851082c2768</id>
<content type='text'>
commit 65caafd0d2145d1dd02072c4ced540624daeab40 upstream.

Reverting commit d03727b248d0 "NFSv4 fix CLOSE not waiting for
direct IO compeletion". This patch made it so that fput() by calling
inode_dio_done() in nfs_file_release() would wait uninterruptably
for any outstanding directIO to the file (but that wait on IO should
be killable).

The problem the patch was also trying to address was REMOVE returning
ERR_ACCESS because the file is still opened, is supposed to be resolved
by server returning ERR_FILE_OPEN and not ERR_ACCESS.

Signed-off-by: Olga Kornievskaia &lt;kolga@netapp.com&gt;
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>NFSv4 fix CLOSE not waiting for direct IO compeletion</title>
<updated>2020-06-30T00:08:04Z</updated>
<author>
<name>Olga Kornievskaia</name>
</author>
<published>2020-06-24T17:54:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cff6b73198f864e12d8fcf90ad26ddc12cfece3f'/>
<id>urn:sha1:cff6b73198f864e12d8fcf90ad26ddc12cfece3f</id>
<content type='text'>
commit d03727b248d0dae6199569a8d7b629a681154633 upstream.

Figuring out the root case for the REMOVE/CLOSE race and
suggesting the solution was done by Neil Brown.

Currently what happens is that direct IO calls hold a reference
on the open context which is decremented as an asynchronous task
in the nfs_direct_complete(). Before reference is decremented,
control is returned to the application which is free to close the
file. When close is being processed, it decrements its reference
on the open_context but since directIO still holds one, it doesn't
sent a close on the wire. It returns control to the application
which is free to do other operations. For instance, it can delete a
file. Direct IO is finally releasing its reference and triggering
an asynchronous close. Which races with the REMOVE. On the server,
REMOVE can be processed before the CLOSE, failing the REMOVE with
EACCES as the file is still opened.

Signed-off-by: Olga Kornievskaia &lt;kolga@netapp.com&gt;
Suggested-by: Neil Brown &lt;neilb@suse.com&gt;
CC: stable@vger.kernel.org
Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>NFS: direct.c: Fix memory leak of dreq when nfs_get_lock_context fails</title>
<updated>2020-04-24T05:57:24Z</updated>
<author>
<name>Misono Tomohiro</name>
</author>
<published>2019-08-28T08:01:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4d92b525f600e7f1bbf4abffb4dd722933302e29'/>
<id>urn:sha1:4d92b525f600e7f1bbf4abffb4dd722933302e29</id>
<content type='text'>
[ Upstream commit 8605cf0e852af3b2c771c18417499dc4ceed03d5 ]

When dreq is allocated by nfs_direct_req_alloc(), dreq-&gt;kref is
initialized to 2. Therefore we need to call nfs_direct_req_release()
twice to release the allocated dreq. Usually it is called in
nfs_file_direct_{read, write}() and nfs_direct_complete().

However, current code only calls nfs_direct_req_relese() once if
nfs_get_lock_context() fails in nfs_file_direct_{read, write}().
So, that case would result in memory leak.

Fix this by adding the missing call.

Signed-off-by: Misono Tomohiro &lt;misono.tomohiro@jp.fujitsu.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>NFS41: pop some layoutget errors to application</title>
<updated>2019-03-23T07:44:38Z</updated>
<author>
<name>Peng Tao</name>
</author>
<published>2015-12-03T18:57:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=58cc0b4098d342ed0d12050d97ce021c387b140e'/>
<id>urn:sha1:58cc0b4098d342ed0d12050d97ce021c387b140e</id>
<content type='text'>
commit d600ad1f2bdbf97c4818dcc85b174f72c90c21bd upstream.

For ERESTARTSYS/EIO/EROFS/ENOSPC/E2BIG in layoutget, we
should just bail out instead of hiding the error and
retrying inband IO.

Change all the call sites to pop the error all the way up.

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>NFS: Fix an incorrect type in struct nfs_direct_req</title>
<updated>2018-03-18T10:17:52Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2018-03-06T17:47:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=099bccc187fcd2326d128f72d6d583675faa790b'/>
<id>urn:sha1:099bccc187fcd2326d128f72d6d583675faa790b</id>
<content type='text'>
commit d9ee65539d3eabd9ade46cca1780e3309ad0f907 upstream.

The start offset needs to be of type loff_t.

Fixed: 5fadeb47dcc5c ("nfs: count DIO good bytes correctly with mirroring")
Cc: stable@vger.kernel.org # v4.0+
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: commit direct writes even if they fail partially</title>
<updated>2018-02-16T19:09:42Z</updated>
<author>
<name>J. Bruce Fields</name>
</author>
<published>2018-01-16T15:08:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ae0499e7b11fe83717b0f3aebb436cdeabf5ba66'/>
<id>urn:sha1:ae0499e7b11fe83717b0f3aebb436cdeabf5ba66</id>
<content type='text'>
commit 1b8d97b0a837beaf48a8449955b52c650a7114b4 upstream.

If some of the WRITE calls making up an O_DIRECT write syscall fail,
we neglect to commit, even if some of the WRITEs succeed.

We also depend on the commit code to free the reference count on the
nfs_page taken in the "if (request_commit)" case at the end of
nfs_direct_write_completion().  The problem was originally noticed
because ENOSPC's encountered partway through a write would result in a
closed file being sillyrenamed when it should have been unlinked.

Signed-off-by: J. Bruce Fields &lt;bfields@redhat.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: Skip checking ds_cinfo.buckets when lseg's commit_through_mds is set</title>
<updated>2015-09-22T22:09:14Z</updated>
<author>
<name>Kinglong Mee</name>
</author>
<published>2015-09-21T22:54:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=834e465bba38f2768747bccb5f00e951e72d2bf5'/>
<id>urn:sha1:834e465bba38f2768747bccb5f00e951e72d2bf5</id>
<content type='text'>
When lseg's commit_through_mds is set, pnfs client always WARN once
in nfs_direct_select_verf after checking ds_cinfo.nbuckets.

nfs should use the DS verf except commit_through_mds is set for
layout segment where nbuckets is zero.

[17844.666094] ------------[ cut here ]------------
[17844.667071] WARNING: CPU: 0 PID: 21758 at /root/source/linux-pnfs/fs/nfs/direct.c:174 nfs_direct_select_verf+0x5a/0x70 [nfs]()
[17844.668650] Modules linked in: nfs_layout_nfsv41_files(OE) nfsv4(OE) nfs(OE) fscache(E) nfsd(OE) xfs libcrc32c btrfs ppdev coretemp crct10dif_pclmul auth_rpcgss crc32_pclmul crc32c_intel nfs_acl ghash_clmulni_intel lockd vmw_balloon xor vmw_vmci grace raid6_pq shpchp sunrpc parport_pc i2c_piix4 parport vmwgfx drm_kms_helper ttm drm serio_raw mptspi e1000 scsi_transport_spi mptscsih mptbase ata_generic pata_acpi [last unloaded: fscache]
[17844.686676] CPU: 0 PID: 21758 Comm: kworker/0:1 Tainted: G        W  OE   4.3.0-rc1-pnfs+ #245
[17844.687352] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 05/20/2014
[17844.698502] Workqueue: nfsiod rpc_async_release [sunrpc]
[17844.699212]  0000000000000009 0000000043e58010 ffff8800454fbc10 ffffffff813680c4
[17844.699990]  ffff8800454fbc48 ffffffff8108b49d ffff88004eb20000 ffff88004eb20000
[17844.700844]  ffff880062e26000 0000000000000000 0000000000000001 ffff8800454fbc58
[17844.701637] Call Trace:
[17844.725252]  [&lt;ffffffff813680c4&gt;] dump_stack+0x19/0x25
[17844.732693]  [&lt;ffffffff8108b49d&gt;] warn_slowpath_common+0x7d/0xb0
[17844.733855]  [&lt;ffffffff8108b5da&gt;] warn_slowpath_null+0x1a/0x20
[17844.735015]  [&lt;ffffffffa04a27ca&gt;] nfs_direct_select_verf+0x5a/0x70 [nfs]
[17844.735999]  [&lt;ffffffffa04a2b83&gt;] nfs_direct_set_hdr_verf+0x23/0x90 [nfs]
[17844.736846]  [&lt;ffffffffa04a2e17&gt;] nfs_direct_write_completion+0x227/0x260 [nfs]
[17844.737782]  [&lt;ffffffffa04a433c&gt;] nfs_pgio_release+0x1c/0x20 [nfs]
[17844.738597]  [&lt;ffffffffa0502df3&gt;] pnfs_generic_rw_release+0x23/0x30 [nfsv4]
[17844.739486]  [&lt;ffffffffa01cbbea&gt;] rpc_free_task+0x2a/0x70 [sunrpc]
[17844.740326]  [&lt;ffffffffa01cbcd5&gt;] rpc_async_release+0x15/0x20 [sunrpc]
[17844.741173]  [&lt;ffffffff810a387c&gt;] process_one_work+0x21c/0x4c0
[17844.741984]  [&lt;ffffffff810a37cd&gt;] ? process_one_work+0x16d/0x4c0
[17844.742837]  [&lt;ffffffff810a3b6a&gt;] worker_thread+0x4a/0x440
[17844.743639]  [&lt;ffffffff810a3b20&gt;] ? process_one_work+0x4c0/0x4c0
[17844.744399]  [&lt;ffffffff810a3b20&gt;] ? process_one_work+0x4c0/0x4c0
[17844.745176]  [&lt;ffffffff810a8d75&gt;] kthread+0xf5/0x110
[17844.745927]  [&lt;ffffffff810a8c80&gt;] ? kthread_create_on_node+0x240/0x240
[17844.747105]  [&lt;ffffffff8172ce1f&gt;] ret_from_fork+0x3f/0x70
[17844.747856]  [&lt;ffffffff810a8c80&gt;] ? kthread_create_on_node+0x240/0x240
[17844.748642] ---[ end trace 336a2845d42b83f0 ]---

Signed-off-by: Kinglong Mee &lt;kinglongmee@gmail.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'nfs-for-4.1-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs</title>
<updated>2015-04-27T00:33:59Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2015-04-27T00:33:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=59953fba87e5e535657403cc6439d24187929559'/>
<id>urn:sha1:59953fba87e5e535657403cc6439d24187929559</id>
<content type='text'>
Pull NFS client updates from Trond Myklebust:
 "Another set of mainly bugfixes and a couple of cleanups.  No new
  functionality in this round.

  Highlights include:

  Stable patches:
   - Fix a regression in /proc/self/mountstats
   - Fix the pNFS flexfiles O_DIRECT support
   - Fix high load average due to callback thread sleeping

  Bugfixes:
   - Various patches to fix the pNFS layoutcommit support
   - Do not cache pNFS deviceids unless server notifications are enabled
   - Fix a SUNRPC transport reconnection regression
   - make debugfs file creation failure non-fatal in SUNRPC
   - Another fix for circular directory warnings on NFSv4 "junctioned"
     mountpoints
   - Fix locking around NFSv4.2 fallocate() support
   - Truncating NFSv4 file opens should also sync O_DIRECT writes
   - Prevent infinite loop in rpcrdma_ep_create()

  Features:
   - Various improvements to the RDMA transport code's handling of
     memory registration
   - Various code cleanups"

* tag 'nfs-for-4.1-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (55 commits)
  fs/nfs: fix new compiler warning about boolean in switch
  nfs: Remove unneeded casts in nfs
  NFS: Don't attempt to decode missing directory entries
  Revert "nfs: replace nfs_add_stats with nfs_inc_stats when add one"
  NFS: Rename idmap.c to nfs4idmap.c
  NFS: Move nfs_idmap.h into fs/nfs/
  NFS: Remove CONFIG_NFS_V4 checks from nfs_idmap.h
  NFS: Add a stub for GETDEVICELIST
  nfs: remove WARN_ON_ONCE from nfs_direct_good_bytes
  nfs: fix DIO good bytes calculation
  nfs: Fetch MOUNTED_ON_FILEID when updating an inode
  sunrpc: make debugfs file creation failure non-fatal
  nfs: fix high load average due to callback thread sleeping
  NFS: Reduce time spent holding the i_mutex during fallocate()
  NFS: Don't zap caches on fallocate()
  xprtrdma: Make rpcrdma_{un}map_one() into inline functions
  xprtrdma: Handle non-SEND completions via a callout
  xprtrdma: Add "open" memreg op
  xprtrdma: Add "destroy MRs" memreg op
  xprtrdma: Add "reset MRs" memreg op
  ...
</content>
</entry>
<entry>
<title>direct-io: only inc/dec inode-&gt;i_dio_count for file systems</title>
<updated>2015-04-24T19:45:28Z</updated>
<author>
<name>Jens Axboe</name>
</author>
<published>2015-04-15T23:05:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fe0f07d08ee35fb13d2cb048970072fe4f71ad14'/>
<id>urn:sha1:fe0f07d08ee35fb13d2cb048970072fe4f71ad14</id>
<content type='text'>
do_blockdev_direct_IO() increments and decrements the inode
-&gt;i_dio_count for each IO operation. It does this to protect against
truncate of a file. Block devices don't need this sort of protection.

For a capable multiqueue setup, this atomic int is the only shared
state between applications accessing the device for O_DIRECT, and it
presents a scaling wall for that. In my testing, as much as 30% of
system time is spent incrementing and decrementing this value. A mixed
read/write workload improved from ~2.5M IOPS to ~9.6M IOPS, with
better latencies too. Before:

clat percentiles (usec):
 |  1.00th=[   33],  5.00th=[   34], 10.00th=[   34], 20.00th=[   34],
 | 30.00th=[   34], 40.00th=[   34], 50.00th=[   35], 60.00th=[   35],
 | 70.00th=[   35], 80.00th=[   35], 90.00th=[   37], 95.00th=[   80],
 | 99.00th=[   98], 99.50th=[  151], 99.90th=[  155], 99.95th=[  155],
 | 99.99th=[  165]

After:

clat percentiles (usec):
 |  1.00th=[   95],  5.00th=[  108], 10.00th=[  129], 20.00th=[  149],
 | 30.00th=[  155], 40.00th=[  161], 50.00th=[  167], 60.00th=[  171],
 | 70.00th=[  177], 80.00th=[  185], 90.00th=[  201], 95.00th=[  270],
 | 99.00th=[  390], 99.50th=[  398], 99.90th=[  418], 99.95th=[  422],
 | 99.99th=[  438]

In other setups, Robert Elliott reported seeing good performance
improvements:

https://lkml.org/lkml/2015/4/3/557

The more applications accessing the device, the worse it gets.

Add a new direct-io flags, DIO_SKIP_DIO_COUNT, which tells
do_blockdev_direct_IO() that it need not worry about incrementing
or decrementing the inode i_dio_count for this caller.

Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Theodore Ts'o &lt;tytso@mit.edu&gt;
Cc: Elliott, Robert (Server Storage) &lt;elliott@hp.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>nfs: remove WARN_ON_ONCE from nfs_direct_good_bytes</title>
<updated>2015-04-23T19:05:19Z</updated>
<author>
<name>Peng Tao</name>
</author>
<published>2015-04-09T15:02:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=05f54903d9d370a4cd302a85681304d3ec59e5c1'/>
<id>urn:sha1:05f54903d9d370a4cd302a85681304d3ec59e5c1</id>
<content type='text'>
For flexfiles driver, we might choose to read from mirror index other
than 0 while mirror_count is always 1 for read.

Reported-by: Jean Spector &lt;jean@primarydata.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v3.19+
Cc: Weston Andros Adamson &lt;dros@primarydata.com&gt;
Signed-off-by: Peng Tao &lt;tao.peng@primarydata.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
</content>
</entry>
</feed>
