From: Greg Kroah-Hartman Date: Mon, 27 Aug 2012 20:18:46 +0000 (-0700) Subject: 3.0-stable patches X-Git-Tag: v3.5.4~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6c47bd0f1065f2830aa312ac5909c56364d8a616;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches 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 --- 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 index 00000000000..8cd83764158 --- /dev/null +++ b/queue-3.0/nfsv3-ensure-that-do_proc_get_root-reports-errors-correctly.patch @@ -0,0 +1,33 @@ +From 086600430493e04b802bee6e5b3ce0458e4eb77f Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Mon, 20 Aug 2012 12:42:15 -0400 +Subject: NFSv3: Ensure that do_proc_get_root() reports errors correctly + +From: Trond Myklebust + +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 +Signed-off-by: Trond Myklebust +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..947107b7d26 --- /dev/null +++ b/queue-3.0/nfsv4.1-remove-a-bogus-bug_on-in-nfs4_layoutreturn_done.patch @@ -0,0 +1,47 @@ +From 47fbf7976e0b7d9dcdd799e2a1baba19064d9631 Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Wed, 8 Aug 2012 16:03:13 -0400 +Subject: NFSv4.1: Remove a bogus BUG_ON() in nfs4_layoutreturn_done + +From: Trond Myklebust + +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 +Reported-by: Tigran Mkrtchyan +Signed-off-by: Trond Myklebust +Signed-off-by: Greg Kroah-Hartman + +--- + 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__); diff --git a/queue-3.0/series b/queue-3.0/series index 8fadd85eee3..dbfb8f88763 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -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