]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.0-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Aug 2012 20:18:46 +0000 (13:18 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Aug 2012 20:18:46 +0000 (13:18 -0700)
added patches:
nfsv3-ensure-that-do_proc_get_root-reports-errors-correctly.patch
nfsv4.1-remove-a-bogus-bug_on-in-nfs4_layoutreturn_done.patch

queue-3.0/nfsv3-ensure-that-do_proc_get_root-reports-errors-correctly.patch [new file with mode: 0644]
queue-3.0/nfsv4.1-remove-a-bogus-bug_on-in-nfs4_layoutreturn_done.patch [new file with mode: 0644]
queue-3.0/series

diff --git a/queue-3.0/nfsv3-ensure-that-do_proc_get_root-reports-errors-correctly.patch b/queue-3.0/nfsv3-ensure-that-do_proc_get_root-reports-errors-correctly.patch
new file mode 100644 (file)
index 0000000..8cd8376
--- /dev/null
@@ -0,0 +1,33 @@
+From 086600430493e04b802bee6e5b3ce0458e4eb77f Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+Date: Mon, 20 Aug 2012 12:42:15 -0400
+Subject: NFSv3: Ensure that do_proc_get_root() reports errors correctly
+
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+
+commit 086600430493e04b802bee6e5b3ce0458e4eb77f upstream.
+
+If the rpc call to NFS3PROC_FSINFO fails, then we need to report that
+error so that the mount fails. Otherwise we can end up with a
+superblock with completely unusable values for block sizes, maxfilesize,
+etc.
+
+Reported-by: Yuanming Chen <hikvision_linux@163.com>
+Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/nfs/nfs3proc.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/nfs/nfs3proc.c
++++ b/fs/nfs/nfs3proc.c
+@@ -68,7 +68,7 @@ do_proc_get_root(struct rpc_clnt *client
+       nfs_fattr_init(info->fattr);
+       status = rpc_call_sync(client, &msg, 0);
+       dprintk("%s: reply fsinfo: %d\n", __func__, status);
+-      if (!(info->fattr->valid & NFS_ATTR_FATTR)) {
++      if (status == 0 && !(info->fattr->valid & NFS_ATTR_FATTR)) {
+               msg.rpc_proc = &nfs3_procedures[NFS3PROC_GETATTR];
+               msg.rpc_resp = info->fattr;
+               status = rpc_call_sync(client, &msg, 0);
diff --git a/queue-3.0/nfsv4.1-remove-a-bogus-bug_on-in-nfs4_layoutreturn_done.patch b/queue-3.0/nfsv4.1-remove-a-bogus-bug_on-in-nfs4_layoutreturn_done.patch
new file mode 100644 (file)
index 0000000..947107b
--- /dev/null
@@ -0,0 +1,47 @@
+From 47fbf7976e0b7d9dcdd799e2a1baba19064d9631 Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+Date: Wed, 8 Aug 2012 16:03:13 -0400
+Subject: NFSv4.1: Remove a bogus BUG_ON() in nfs4_layoutreturn_done
+
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+
+commit 47fbf7976e0b7d9dcdd799e2a1baba19064d9631 upstream.
+
+Ever since commit 0a57cdac3f (NFSv4.1 send layoutreturn to fence
+disconnected data server) we've been sending layoutreturn calls
+while there is potentially still outstanding I/O to the data
+servers. The reason we do this is to avoid races between replayed
+writes to the MDS and the original writes to the DS.
+
+When this happens, the BUG_ON() in nfs4_layoutreturn_done can
+be triggered because it assumes that we would never call
+layoutreturn without knowing that all I/O to the DS is
+finished. The fix is to remove the BUG_ON() now that the
+assumptions behind the test are obsolete.
+
+Reported-by: Boaz Harrosh <bharrosh@panasas.com>
+Reported-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
+Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/nfs/nfs4proc.c |    8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -5766,12 +5766,8 @@ static void nfs4_layoutreturn_done(struc
+               return;
+       }
+       spin_lock(&lo->plh_inode->i_lock);
+-      if (task->tk_status == 0) {
+-              if (lrp->res.lrs_present) {
+-                      pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
+-              } else
+-                      BUG_ON(!list_empty(&lo->plh_segs));
+-      }
++      if (task->tk_status == 0 && lrp->res.lrs_present)
++              pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
+       lo->plh_block_lgets--;
+       spin_unlock(&lo->plh_inode->i_lock);
+       dprintk("<-- %s\n", __func__);
index 8fadd85eee3acd0700c30fbfa9d2a1c91e023a87..dbfb8f8876381f8b48c1a489b24f438c01838242 100644 (file)
@@ -12,3 +12,5 @@ vfs-canonicalize-create-mode-in-build_open_flags.patch
 alpha-don-t-export-sock_nonblock-to-user-space.patch
 usb-winbond-remove-__devinit-from-the-struct-usb_device_id-table.patch
 mm-hugetlbfs-correctly-populate-shared-pmd.patch
+nfsv3-ensure-that-do_proc_get_root-reports-errors-correctly.patch
+nfsv4.1-remove-a-bogus-bug_on-in-nfs4_layoutreturn_done.patch