<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/nfs/write.c, branch linux-3.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-02-16T19:14:44Z</updated>
<entry>
<title>NFS: Add a cond_resched() to nfs_commit_release_pages()</title>
<updated>2018-02-16T19:14:44Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2017-12-18T19:39:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c8ebc7dd51be8d1ecc34ce43277ec7a6c0405a05'/>
<id>urn:sha1:c8ebc7dd51be8d1ecc34ce43277ec7a6c0405a05</id>
<content type='text'>
commit 7f1bda447c9bd48b415acedba6b830f61591601f upstream.

The commit list can get very large, and so we need a cond_resched()
in nfs_commit_release_pages() in order to ensure we don't hog the CPU
for excessive periods of time.

Reported-by: Mike Galbraith &lt;efault@gmx.de&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: don't create zero-length requests</title>
<updated>2016-08-22T16:23:16Z</updated>
<author>
<name>Benjamin Coddington</name>
</author>
<published>2016-07-18T14:41:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cf4f30b2501fc90f23a935422af07bdddc155678'/>
<id>urn:sha1:cf4f30b2501fc90f23a935422af07bdddc155678</id>
<content type='text'>
[ Upstream commit 149a4fddd0a72d526abbeac0c8deaab03559836a ]

NFS doesn't expect requests with wb_bytes set to zero and may make
unexpected decisions about how to handle that request at the page IO layer.
Skip request creation if we won't have any wb_bytes in the request.

Signed-off-by: Benjamin Coddington &lt;bcodding@redhat.com&gt;
Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Reviewed-by: Weston Andros Adamson &lt;dros@primarydata.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
</content>
</entry>
<entry>
<title>NFS: Ensure we set NFS_CONTEXT_RESEND_WRITES when requeuing writes</title>
<updated>2015-07-04T03:02:33Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2015-06-17T23:56:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2d336687b66cd254c9bdee61b3300d787a8acc1e'/>
<id>urn:sha1:2d336687b66cd254c9bdee61b3300d787a8acc1e</id>
<content type='text'>
[ Upstream commit c70701131f7a8edea91fc49d11796d342cff7c62 ]

If a write attempt fails, and the write is queued up for resending to
the server, as opposed to being dropped, then we need to set the
appropriate flag so that nfs_file_fsync() does the right thing.

Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>nfs: remove spurious WARN_ON_ONCE in write path</title>
<updated>2014-11-12T19:22:52Z</updated>
<author>
<name>Weston Andros Adamson</name>
</author>
<published>2014-11-03T20:19:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=16c9914069536c77ed358d94b6e247bdc464b7f0'/>
<id>urn:sha1:16c9914069536c77ed358d94b6e247bdc464b7f0</id>
<content type='text'>
This WARN_ON_ONCE was supposed to catch reference counting bugs, but can
trigger in inappropriate situations.

This was reproducible using NFSv2 on an architecture with 64K pages -- we
verified that it was not a reference counting bug and the warning was
safe to ignore.

Reported-by: Will Deacon &lt;will.deacon@arm.com&gt;
Tested-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Weston Andros Adamson &lt;dros@primarydata.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
</content>
</entry>
<entry>
<title>NFS: avoid waiting at all in nfs_release_page when congested.</title>
<updated>2014-09-25T12:25:38Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2014-09-24T01:28:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=353db7966288a2f18da22438aeec2b4862c0b241'/>
<id>urn:sha1:353db7966288a2f18da22438aeec2b4862c0b241</id>
<content type='text'>
If nfs_release_page() is called on a sequence of pages which are all
in the same file which is blocked on COMMIT, each page could
contribute a 1 second delay which could be come excessive.  I have
seen delays of as much as 208 seconds.

To keep the delay to one second, mark the bdi as write-congested
if the commit didn't finished.  Once it does finish, the
write-congested flag will be cleared by nfs_commit_release_pages().

With this, the longest total delay in try_to_free_pages that I have
seen is under 3 seconds.  With no waiting in nfs_release_page at all
I have seen delays of nearly 1.5 seconds.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Acked-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
</content>
</entry>
<entry>
<title>NFS: avoid deadlocks with loop-back mounted NFS filesystems.</title>
<updated>2014-09-25T12:25:28Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2014-09-24T01:28:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9590544694becc64f4874963dbfc4b4d391024b7'/>
<id>urn:sha1:9590544694becc64f4874963dbfc4b4d391024b7</id>
<content type='text'>
Support for loop-back mounted NFS filesystems is useful when NFS is
used to access shared storage in a high-availability cluster.

If the node running the NFS server fails, some other node can mount the
filesystem and start providing NFS service.  If that node already had
the filesystem NFS mounted, it will now have it loop-back mounted.

nfsd can suffer a deadlock when allocating memory and entering direct
reclaim.
While direct reclaim does not write to the NFS filesystem it can send
and wait for a COMMIT through nfs_release_page().

This patch modifies nfs_release_page() to wait a limited time for the
commit to complete - one second.  If the commit doesn't complete
in this time, nfs_release_page() will fail.  This means it might now
fail in some cases where it wouldn't before.  These cases are only
when 'gfp' includes '__GFP_WAIT'.

nfs_release_page() is only called by try_to_release_page(), and that
can only be called on an NFS page with required 'gfp' flags from
 - page_cache_pipe_buf_steal() in splice.c
 - shrink_page_list() in vmscan.c
 - invalidate_inode_pages2_range() in truncate.c

The first two handle failure quite safely.  The last is only called
after -&gt;launder_page() has been called, and that will have waited
for the commit to finish already.

So aborting if the commit takes longer than 1 second is perfectly safe.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Acked-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
</content>
</entry>
<entry>
<title>NFS: don't use STABLE writes during writeback.</title>
<updated>2014-09-25T03:23:02Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2014-09-18T06:09:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e87b4c7a7ac6d895846570dec637744cf7050df3'/>
<id>urn:sha1:e87b4c7a7ac6d895846570dec637744cf7050df3</id>
<content type='text'>
commit b31268ac793fd300da66b9c28bbf0a200339ab96
  FS: Use stable writes when not doing a bulk flush

was a bit heavy handed.
The particular problem that lead to this patch was that
small writes to an O_SYNC file we being written as UNSTABLE writes
followed by a commit.
This is appropriate for large writes (which require multiple NFS
requests) but for small writes (single NFS request), using
NFS_FILE_SYNC is more efficient.

So that patch causes the code to select between the two methods
depending on how many nfs requests get generated.

Unfortunately this ends up applying to non O_SYNC writes as well.
In particular if you memory-map a file and update random pages, then
when they are eventually written out by writeback they will go as
NFS_FILE_SYNC.  This is inefficient and slows down the application.

So: only set FLUSH_COND_STABLE when wbc-&gt;sync_mode is WB_SYNC_ALL.
With this patch:
 O_SYNC writes are NFS_FILE_SYNC for single requests, and NFS_UNSTABLE
    followed by COMMIT for multiple requests
 Writing immediately before close of fsync follow the same pattern.
 Non-O_SYNC writes without an fsync of close eventually get flushed
 out as UNSTABLE and a commit follows eventually as appropriate.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
</content>
</entry>
<entry>
<title>NFS: Unconditionally enable commit code</title>
<updated>2014-09-12T17:49:31Z</updated>
<author>
<name>Anna Schumaker</name>
</author>
<published>2014-09-03T16:19:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f418c64b71590bac8fdebd0969a1eeaffaf036d2'/>
<id>urn:sha1:f418c64b71590bac8fdebd0969a1eeaffaf036d2</id>
<content type='text'>
The goal is to create a generic NFS module with code that does not
depend on what versions of NFS are enabled.

Signed-off-by: Anna Schumaker &lt;Anna.Schumaker@Netapp.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
</content>
</entry>
<entry>
<title>NFS: Fix a compile warning when !(CONFIG_NFS_V3 || CONFIG_NFS_V4)</title>
<updated>2014-09-10T19:47:02Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2014-09-09T05:21:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a3908c8b09d5ec19d543836d4f38d240ae27fe8'/>
<id>urn:sha1:3a3908c8b09d5ec19d543836d4f38d240ae27fe8</id>
<content type='text'>
gcc reports:

linux/fs/nfs/write.c: In function ‘nfs_page_find_head_request_locked.isra.17’:
linux/fs/nfs/write.c:121:64: warning: ‘cinfo.mds’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  list_for_each_entry_safe(freq, t, &amp;cinfo.mds-&gt;list, wb_list) {
                                                                  ^
linux/fs/nfs/write.c:110:25: note: ‘cinfo.mds’ was declared here
  struct nfs_commit_info cinfo;

Reported-by: Anna Schumaker &lt;Anna.Schumaker@netapp.com&gt;
Cc: Weston Andros Adamson &lt;dros@primarydata.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
</content>
</entry>
<entry>
<title>nfs41: add a helper function to set layoutcommit after commit</title>
<updated>2014-09-10T19:47:00Z</updated>
<author>
<name>Peng Tao</name>
</author>
<published>2014-08-07T02:15:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=378520b837cf4da769600b83690d8e825f16a611'/>
<id>urn:sha1:378520b837cf4da769600b83690d8e825f16a611</id>
<content type='text'>
Track lwb in nfs_commit_data so that we can use it to setup
layoutcommit in commit_done callback.

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>
