]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
.37 patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Fri, 25 Mar 2011 19:09:20 +0000 (12:09 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 25 Mar 2011 19:09:20 +0000 (12:09 -0700)
queue-2.6.37/dcdbas-force-smi-to-happen-when-expected.patch [new file with mode: 0644]
queue-2.6.37/fs-call-security_d_instantiate-in-d_obtain_alias-v2.patch [new file with mode: 0644]
queue-2.6.37/nfs-fix-a-hang-infinite-loop-in-nfs_wb_page.patch [new file with mode: 0644]
queue-2.6.37/series
queue-2.6.37/sunrpc-never-reuse-the-socket-port-after-an-xs_close.patch [new file with mode: 0644]

diff --git a/queue-2.6.37/dcdbas-force-smi-to-happen-when-expected.patch b/queue-2.6.37/dcdbas-force-smi-to-happen-when-expected.patch
new file mode 100644 (file)
index 0000000..594d66b
--- /dev/null
@@ -0,0 +1,39 @@
+From dd65c736d1b5312c80c88a64bf521db4959eded5 Mon Sep 17 00:00:00 2001
+From: Stuart Hayes <stuart_hayes@yahoo.com>
+Date: Wed, 2 Mar 2011 13:42:05 +0100
+Subject: dcdbas: force SMI to happen when expected
+
+From: Stuart Hayes <stuart_hayes@yahoo.com>
+
+commit dd65c736d1b5312c80c88a64bf521db4959eded5 upstream.
+
+The dcdbas driver can do an I/O write to cause a SMI to occur.  The SMI handler
+looks at certain registers and memory locations, so the SMI needs to happen
+immediately.  On some systems I/O writes are posted, though, causing the SMI to
+happen well after the "outb" occurred, which causes random failures.  Following
+the "outb" with an "inb" forces the write to go through even if it is posted.
+
+Signed-off-by: Stuart Hayes <stuart_hayes@yahoo.com>
+Acked-by: Doug Warzecha <douglas_warzecha@dell.com>
+Cc: Chuck Ebbert <cebbert@redhat.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/firmware/dcdbas.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/firmware/dcdbas.c
++++ b/drivers/firmware/dcdbas.c
+@@ -268,8 +268,10 @@ int dcdbas_smi_request(struct smi_cmd *s
+       }
+       /* generate SMI */
++      /* inb to force posted write through and make SMI happen now */
+       asm volatile (
+-              "outb %b0,%w1"
++              "outb %b0,%w1\n"
++              "inb %w1"
+               : /* no output args */
+               : "a" (smi_cmd->command_code),
+                 "d" (smi_cmd->command_address),
diff --git a/queue-2.6.37/fs-call-security_d_instantiate-in-d_obtain_alias-v2.patch b/queue-2.6.37/fs-call-security_d_instantiate-in-d_obtain_alias-v2.patch
new file mode 100644 (file)
index 0000000..d2348da
--- /dev/null
@@ -0,0 +1,55 @@
+From 24ff6663ccfdaf088dfa7acae489cb11ed4f43c4 Mon Sep 17 00:00:00 2001
+From: Josef Bacik <josef@redhat.com>
+Date: Thu, 18 Nov 2010 20:52:55 -0500
+Subject: fs: call security_d_instantiate in d_obtain_alias V2
+
+From: Josef Bacik <josef@redhat.com>
+
+commit 24ff6663ccfdaf088dfa7acae489cb11ed4f43c4 upstream.
+
+While trying to track down some NFS problems with BTRFS, I kept noticing I was
+getting -EACCESS for no apparent reason.  Eric Paris and printk() helped me
+figure out that it was SELinux that was giving me grief, with the following
+denial
+
+type=AVC msg=audit(1290013638.413:95): avc:  denied  { 0x800000 } for  pid=1772
+comm="nfsd" name="" dev=sda1 ino=256 scontext=system_u:system_r:kernel_t:s0
+tcontext=system_u:object_r:unlabeled_t:s0 tclass=file
+
+Turns out this is because in d_obtain_alias if we can't find an alias we create
+one and do all the normal instantiation stuff, but we don't do the
+security_d_instantiate.
+
+Usually we are protected from getting a hashed dentry that hasn't yet run
+security_d_instantiate() by the parent's i_mutex, but obviously this isn't an
+option there, so in order to deal with the case that a second thread comes in
+and finds our new dentry before we get to run security_d_instantiate(), we go
+ahead and call it if we find a dentry already.  Eric assures me that this is ok
+as the code checks to see if the dentry has been initialized already so calling
+security_d_instantiate() against the same dentry multiple times is ok.  With
+this patch I'm no longer getting errant -EACCESS values.
+
+Signed-off-by: Josef Bacik <josef@redhat.com>
+Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
+Cc: Chuck Ebbert <cebbert@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/dcache.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/fs/dcache.c
++++ b/fs/dcache.c
+@@ -1201,9 +1201,12 @@ struct dentry *d_obtain_alias(struct ino
+       spin_unlock(&tmp->d_lock);
+       spin_unlock(&dcache_lock);
++      security_d_instantiate(tmp, inode);
+       return tmp;
+  out_iput:
++      if (res && !IS_ERR(res))
++              security_d_instantiate(res, inode);
+       iput(inode);
+       return res;
+ }
diff --git a/queue-2.6.37/nfs-fix-a-hang-infinite-loop-in-nfs_wb_page.patch b/queue-2.6.37/nfs-fix-a-hang-infinite-loop-in-nfs_wb_page.patch
new file mode 100644 (file)
index 0000000..ae8ef5d
--- /dev/null
@@ -0,0 +1,84 @@
+From b8413f98f997bb3ed7327e6d7117e7e91ce010c3 Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+Date: Mon, 21 Mar 2011 15:37:01 -0400
+Subject: NFS: Fix a hang/infinite loop in nfs_wb_page()
+
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+
+commit b8413f98f997bb3ed7327e6d7117e7e91ce010c3 upstream.
+
+When one of the two waits in nfs_commit_inode() is interrupted, it
+returns a non-negative value, which causes nfs_wb_page() to think
+that the operation was successful causing it to busy-loop rather
+than exiting.
+It also causes nfs_file_fsync() to incorrectly report the file as
+being successfully committed to disk.
+
+This patch fixes both problems by ensuring that we return an error
+if the attempts to wait fail.
+
+Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/nfs/write.c |   31 +++++++++++++++++++------------
+ 1 file changed, 19 insertions(+), 12 deletions(-)
+
+--- a/fs/nfs/write.c
++++ b/fs/nfs/write.c
+@@ -1214,13 +1214,17 @@ int nfs_writeback_done(struct rpc_task *
+ #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
+ static int nfs_commit_set_lock(struct nfs_inode *nfsi, int may_wait)
+ {
++      int ret;
++
+       if (!test_and_set_bit(NFS_INO_COMMIT, &nfsi->flags))
+               return 1;
+-      if (may_wait && !out_of_line_wait_on_bit_lock(&nfsi->flags,
+-                              NFS_INO_COMMIT, nfs_wait_bit_killable,
+-                              TASK_KILLABLE))
+-              return 1;
+-      return 0;
++      if (!may_wait)
++              return 0;
++      ret = out_of_line_wait_on_bit_lock(&nfsi->flags,
++                              NFS_INO_COMMIT,
++                              nfs_wait_bit_killable,
++                              TASK_KILLABLE);
++      return (ret < 0) ? ret : 1;
+ }
+ static void nfs_commit_clear_lock(struct nfs_inode *nfsi)
+@@ -1394,9 +1398,10 @@ int nfs_commit_inode(struct inode *inode
+ {
+       LIST_HEAD(head);
+       int may_wait = how & FLUSH_SYNC;
+-      int res = 0;
++      int res;
+-      if (!nfs_commit_set_lock(NFS_I(inode), may_wait))
++      res = nfs_commit_set_lock(NFS_I(inode), may_wait);
++      if (res <= 0)
+               goto out_mark_dirty;
+       spin_lock(&inode->i_lock);
+       res = nfs_scan_commit(inode, &head, 0, 0);
+@@ -1405,12 +1410,14 @@ int nfs_commit_inode(struct inode *inode
+               int error = nfs_commit_list(inode, &head, how);
+               if (error < 0)
+                       return error;
+-              if (may_wait)
+-                      wait_on_bit(&NFS_I(inode)->flags, NFS_INO_COMMIT,
+-                                      nfs_wait_bit_killable,
+-                                      TASK_KILLABLE);
+-              else
++              if (!may_wait)
+                       goto out_mark_dirty;
++              error = wait_on_bit(&NFS_I(inode)->flags,
++                              NFS_INO_COMMIT,
++                              nfs_wait_bit_killable,
++                              TASK_KILLABLE);
++              if (error < 0)
++                      return error;
+       } else
+               nfs_commit_clear_lock(NFS_I(inode));
+       return res;
index 07c5ffe684bf79da7dba7e7fd67782924f7401c9..4320a049cdaedfa585b62e122c993a95cda8ede7 100644 (file)
@@ -48,3 +48,7 @@ drm-fix-use-after-free-in-drm_gem_vm_close.patch
 drm-radeon-kms-prefer-legacy-pll-algo-for-tv-out.patch
 drm-radeon-kms-fix-hardcoded-edid-handling.patch
 perf-fix-tear-down-of-inherited-group-events.patch
+nfs-fix-a-hang-infinite-loop-in-nfs_wb_page.patch
+sunrpc-never-reuse-the-socket-port-after-an-xs_close.patch
+fs-call-security_d_instantiate-in-d_obtain_alias-v2.patch
+dcdbas-force-smi-to-happen-when-expected.patch
diff --git a/queue-2.6.37/sunrpc-never-reuse-the-socket-port-after-an-xs_close.patch b/queue-2.6.37/sunrpc-never-reuse-the-socket-port-after-an-xs_close.patch
new file mode 100644 (file)
index 0000000..1bb9734
--- /dev/null
@@ -0,0 +1,31 @@
+From 246408dcd5dfeef2df437ccb0ef4d6ee87805f58 Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+Date: Tue, 22 Mar 2011 18:40:10 -0400
+Subject: SUNRPC: Never reuse the socket port after an xs_close()
+
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+
+commit 246408dcd5dfeef2df437ccb0ef4d6ee87805f58 upstream.
+
+If we call xs_close(), we're in one of two situations:
+ - Autoclose, which means we don't expect to resend a request
+ - bind+connect failed, which probably means the port is in use
+
+Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ net/sunrpc/xprtsock.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/net/sunrpc/xprtsock.c
++++ b/net/sunrpc/xprtsock.c
+@@ -710,6 +710,8 @@ static void xs_reset_transport(struct so
+       if (sk == NULL)
+               return;
++      transport->srcport = 0;
++
+       write_lock_bh(&sk->sk_callback_lock);
+       transport->inet = NULL;
+       transport->sock = NULL;