]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Revert "ceph: unlock dangling spinlock in try_flush_caps()"
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Nov 2017 17:26:01 +0000 (18:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Nov 2017 10:06:28 +0000 (11:06 +0100)
This reverts commit 55d4aa12af57ea7782f0c8bbc3b01e44673b05ba which is
commit 6c2838fbdedb9b72a81c931d49e56b229b6cdbca upstream.

The locking issue was not a problem in 3.18, and now sparse rightly
complains about this being an issue, so go back to the "correct" code.

Cc: Jeff Layton <jlayton@redhat.com>
Cc: "Yan, Zheng" <zyan@redhat.com>
Cc: Ilya Dryomov <idryomov@gmail.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ceph/caps.c

index 45692e8a9397132bee43720c859b339101b8c58c..cefca661464b91a4edae048a8567e900d8560df6 100644 (file)
@@ -1748,7 +1748,6 @@ static int try_flush_caps(struct inode *inode, unsigned *flush_tid)
 retry:
        spin_lock(&ci->i_ceph_lock);
        if (ci->i_ceph_flags & CEPH_I_NOFLUSH) {
-               spin_unlock(&ci->i_ceph_lock);
                dout("try_flush_caps skipping %p I_NOFLUSH set\n", inode);
                goto out;
        }
@@ -1766,10 +1765,8 @@ retry:
                        mutex_lock(&session->s_mutex);
                        goto retry;
                }
-               if (cap->session->s_state < CEPH_MDS_SESSION_OPEN) {
-                       spin_unlock(&ci->i_ceph_lock);
+               if (cap->session->s_state < CEPH_MDS_SESSION_OPEN)
                        goto out;
-               }
 
                flushing = __mark_caps_flushing(inode, session);