<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/nfs/file.c, branch linux-3.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.3.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.3.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2012-01-05T15:42:39Z</updated>
<entry>
<title>NFS - fix recent breakage to NFS error handling.</title>
<updated>2012-01-05T15:42:39Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2011-11-16T00:46:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2edb6bc3852c681c0d948245bd55108dc6407604'/>
<id>urn:sha1:2edb6bc3852c681c0d948245bd55108dc6407604</id>
<content type='text'>
From c6d615d2b97fe305cbf123a8751ced859dca1d5e Mon Sep 17 00:00:00 2001
From: NeilBrown &lt;neilb@suse.de&gt;
Date: Wed, 16 Nov 2011 09:39:05 +1100
Subject: [PATCH] NFS - fix recent breakage to NFS error handling.

commit 02c24a82187d5a628c68edfe71ae60dc135cd178 made a small and
presumably unintended change to write error handling in NFS.

Previously an error from filemap_write_and_wait_range would only be of
interest if nfs_file_fsync did not return an error.  After this commit,
an error from filemap_write_and_wait_range would mean that (the rest of)
nfs_file_fsync would not even be called.

This means that:
 1/ you are more likely to see EIO than e.g. EDQUOT or ENOSPC.
 2/ NFS_CONTEXT_ERROR_WRITE remains set for longer so more writes are
    synchronous.

This patch restores previous behaviour.

Cc: stable@kernel.org
Cc: Josef Bacik &lt;josef@redhat.com&gt;
Cc: Jan Kara &lt;jack@suse.cz&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
</entry>
<entry>
<title>NFS: Fix a regression in nfs_file_llseek()</title>
<updated>2011-12-15T23:44:36Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2011-12-15T23:38:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6c52961743f38747401b47127b82159ab6d8a7a4'/>
<id>urn:sha1:6c52961743f38747401b47127b82159ab6d8a7a4</id>
<content type='text'>
After commit 06222e491e663dac939f04b125c9dc52126a75c4 (fs: handle
SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek)
the behaviour of llseek() was changed so that it always revalidates
the file size. The bug appears to be due to a logic error in the
afore-mentioned commit, which always evaluates to 'true'.

Reported-by: Roel Kluin &lt;roel.kluin@gmail.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Cc: stable@vger.kernel.org [&gt;=3.1]
</content>
</entry>
<entry>
<title>nfs: move nfs_file_operations declaration to bottom of file.c (try #2)</title>
<updated>2011-11-04T20:39:11Z</updated>
<author>
<name>Jeff Layton</name>
</author>
<published>2011-11-04T17:31:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0486958f57a496212e3c1e3d9194deebba3dc3d4'/>
<id>urn:sha1:0486958f57a496212e3c1e3d9194deebba3dc3d4</id>
<content type='text'>
...a remove a set of forward declarations.

Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
</entry>
<entry>
<title>nfs: when attempting to open a directory, fall back on normal lookup (try #5)</title>
<updated>2011-11-04T20:39:04Z</updated>
<author>
<name>Jeff Layton</name>
</author>
<published>2011-11-04T17:31:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1788ea6e3b2a58cf4fb00206e362d9caff8d86a7'/>
<id>urn:sha1:1788ea6e3b2a58cf4fb00206e362d9caff8d86a7</id>
<content type='text'>
commit d953126 changed how nfs_atomic_lookup handles an -EISDIR return
from an OPEN call. Prior to that patch, that caused the client to fall
back to doing a normal lookup. When that patch went in, the code began
returning that error to userspace. The d_revalidate codepath however
never had the corresponding change, so it was still possible to end up
with a NULL ctx-&gt;state pointer after that.

That patch caused a regression. When we attempt to open a directory that
does not have a cached dentry, that open now errors out with EISDIR. If
you attempt the same open with a cached dentry, it will succeed.

Fix this by reverting the change in nfs_atomic_lookup and allowing
attempts to open directories to fall back to a normal lookup

Also, add a NFSv4-specific f_ops-&gt;open routine that just returns
-ENOTDIR. This should never be called if things are working properly,
but if it ever is, then the dprintk may help in debugging.

To facilitate this, a new file_operations field is also added to the
nfs_rpc_ops struct.

Cc: stable@kernel.org
Signed-off-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'osd-devel' into nfs-for-next</title>
<updated>2011-11-03T03:56:40Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2011-11-03T03:56:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=31cbecb4ab538f433145bc5a46f3bea9b9627031'/>
<id>urn:sha1:31cbecb4ab538f433145bc5a46f3bea9b9627031</id>
<content type='text'>
</content>
</entry>
<entry>
<title>nfs: Fix unused variable warning from file.c</title>
<updated>2011-11-03T03:49:09Z</updated>
<author>
<name>Rakib Mullick</name>
</author>
<published>2011-11-01T06:16:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6f276e49fd108362be3fd67154aaaacf872ea026'/>
<id>urn:sha1:6f276e49fd108362be3fd67154aaaacf872ea026</id>
<content type='text'>
Fix the following unused variable warning.

fs/nfs/file.c: In function ‘nfs_file_release’:
fs/nfs/file.c:140:17: warning: unused variable ‘dentry’
fs/nfs/file.c: In function ‘nfs_file_read’:
fs/nfs/file.c:237:9: warning: unused variable ‘count’

Signed-off-by: Rakib Mullick &lt;rakib.mullick@gmail.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
</entry>
<entry>
<title>nfs: drop unnecessary locking in llseek</title>
<updated>2011-10-28T12:59:00Z</updated>
<author>
<name>Andi Kleen</name>
</author>
<published>2011-09-15T23:06:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=79835a710d6ff811659c8de46f89c7577c3b8cc6'/>
<id>urn:sha1:79835a710d6ff811659c8de46f89c7577c3b8cc6</id>
<content type='text'>
This makes NFS follow the standard generic_file_llseek locking scheme.

Cc: Trond.Myklebust@netapp.com
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>vfs: do (nearly) lockless generic_file_llseek</title>
<updated>2011-10-28T12:58:58Z</updated>
<author>
<name>Andi Kleen</name>
</author>
<published>2011-09-15T23:06:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ef3d0fd27e90f67e35da516dafc1482c82939a60'/>
<id>urn:sha1:ef3d0fd27e90f67e35da516dafc1482c82939a60</id>
<content type='text'>
The i_mutex lock use of generic _file_llseek hurts.  Independent processes
accessing the same file synchronize over a single lock, even though
they have no need for synchronization at all.

Under high utilization this can cause llseek to scale very poorly on larger
systems.

This patch does some rethinking of the llseek locking model:

First the 64bit f_pos is not necessarily atomic without locks
on 32bit systems. This can already cause races with read() today.
This was discussed on linux-kernel in the past and deemed acceptable.
The patch does not change that.

Let's look at the different seek variants:

SEEK_SET: Doesn't really need any locking.
If there's a race one writer wins, the other loses.

For 32bit the non atomic update races against read()
stay the same. Without a lock they can also happen
against write() now.  The read() race was deemed
acceptable in past discussions, and I think if it's
ok for read it's ok for write too.

=&gt; Don't need a lock.

SEEK_END: This behaves like SEEK_SET plus it reads
the maximum size too. Reading the maximum size would have the
32bit atomic problem. But luckily we already have a way to read
the maximum size without locking (i_size_read), so we
can just use that instead.

Without i_mutex there is no synchronization with write() anymore,
however since the write() update is atomic on 64bit it just behaves
like another racy SEEK_SET.  On non atomic 32bit it's the same
as SEEK_SET.

=&gt; Don't need a lock, but need to use i_size_read()

SEEK_CUR: This has a read-modify-write race window
on the same file. One could argue that any application
doing unsynchronized seeks on the same file is already broken.
But for the sake of not adding a regression here I'm
using the file-&gt;f_lock to synchronize this. Using this
lock is much better than the inode mutex because it doesn't
synchronize between processes.

=&gt; So still need a lock, but can use a f_lock.

This patch implements this new scheme in generic_file_llseek.
I dropped generic_file_llseek_unlocked and changed all callers.

Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>fs: push i_mutex and filemap_write_and_wait down into -&gt;fsync() handlers</title>
<updated>2011-07-21T00:47:59Z</updated>
<author>
<name>Josef Bacik</name>
</author>
<published>2011-07-17T00:44:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=02c24a82187d5a628c68edfe71ae60dc135cd178'/>
<id>urn:sha1:02c24a82187d5a628c68edfe71ae60dc135cd178</id>
<content type='text'>
Btrfs needs to be able to control how filemap_write_and_wait_range() is called
in fsync to make it less of a painful operation, so push down taking i_mutex and
the calling of filemap_write_and_wait() down into the -&gt;fsync() handlers.  Some
file systems can drop taking the i_mutex altogether it seems, like ext3 and
ocfs2.  For correctness sake I just pushed everything down in all cases to make
sure that we keep the current behavior the same for everybody, and then each
individual fs maintainer can make up their mind about what to do from there.
Thanks,

Acked-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Josef Bacik &lt;josef@redhat.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek</title>
<updated>2011-07-21T00:47:58Z</updated>
<author>
<name>Josef Bacik</name>
</author>
<published>2011-07-18T17:21:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=06222e491e663dac939f04b125c9dc52126a75c4'/>
<id>urn:sha1:06222e491e663dac939f04b125c9dc52126a75c4</id>
<content type='text'>
This converts everybody to handle SEEK_HOLE/SEEK_DATA properly.  In some cases
we just return -EINVAL, in others we do the normal generic thing, and in others
we're simply making sure that the properly due-dilligence is done.  For example
in NFS/CIFS we need to make sure the file size is update properly for the
SEEK_HOLE and SEEK_DATA case, but since it calls the generic llseek stuff itself
that is all we have to do.  Thanks,

Signed-off-by: Josef Bacik &lt;josef@redhat.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
