]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0024-NFS-fix-recent-breakage-to-NFS-error-handling.patch
linux-ti335x-psp 3.2: update to v3.2.11
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.2 / 0024-NFS-fix-recent-breakage-to-NFS-error-handling.patch
1 From 7738b871ed07b550480b1b26d7bb6349f54c3d55 Mon Sep 17 00:00:00 2001
2 From: NeilBrown <neilb@suse.de>
3 Date: Wed, 16 Nov 2011 11:46:31 +1100
4 Subject: [PATCH 024/130] NFS - fix recent breakage to NFS error handling.
6 commit 2edb6bc3852c681c0d948245bd55108dc6407604 upstream.
8         From c6d615d2b97fe305cbf123a8751ced859dca1d5e Mon Sep 17 00:00:00 2001
9         From: NeilBrown <neilb@suse.de>
10         Date: Wed, 16 Nov 2011 09:39:05 +1100
11         Subject: NFS - fix recent breakage to NFS error handling.
13 commit 02c24a82187d5a628c68edfe71ae60dc135cd178 made a small and
14 presumably unintended change to write error handling in NFS.
16 Previously an error from filemap_write_and_wait_range would only be of
17 interest if nfs_file_fsync did not return an error.  After this commit,
18 an error from filemap_write_and_wait_range would mean that (the rest of)
19 nfs_file_fsync would not even be called.
21 This means that:
22  1/ you are more likely to see EIO than e.g. EDQUOT or ENOSPC.
23  2/ NFS_CONTEXT_ERROR_WRITE remains set for longer so more writes are
24     synchronous.
26 This patch restores previous behaviour.
28 Cc: Josef Bacik <josef@redhat.com>
29 Cc: Jan Kara <jack@suse.cz>
30 Cc: Al Viro <viro@zeniv.linux.org.uk>
31 Signed-off-by: NeilBrown <neilb@suse.de>
32 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
33 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
34 ---
35  fs/nfs/file.c |    4 ++--
36  1 file changed, 2 insertions(+), 2 deletions(-)
38 diff --git a/fs/nfs/file.c b/fs/nfs/file.c
39 index 606ef0f..c43a452 100644
40 --- a/fs/nfs/file.c
41 +++ b/fs/nfs/file.c
42 @@ -272,13 +272,13 @@ nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync)
43                         datasync);
44  
45         ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
46 -       if (ret)
47 -               return ret;
48         mutex_lock(&inode->i_mutex);
49  
50         nfs_inc_stats(inode, NFSIOS_VFSFSYNC);
51         have_error = test_and_clear_bit(NFS_CONTEXT_ERROR_WRITE, &ctx->flags);
52         status = nfs_commit_inode(inode, FLUSH_SYNC);
53 +       if (status >= 0 && ret < 0)
54 +               status = ret;
55         have_error |= test_bit(NFS_CONTEXT_ERROR_WRITE, &ctx->flags);
56         if (have_error)
57                 ret = xchg(&ctx->error, 0);
58 -- 
59 1.7.9.4