lkml.org 
[lkml]   [2020]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] fs/gfs2:lock a spinlock always before returning from do_xmote()
Date
The call stack is as follows:
finish_xmote()
...
spin_lock(&gl->gl_lockref.lock);
...
--> do_xmote()
spin_unlock(&gl->gl_lockref.lock);
...
return;
...
spin_unlock(&gl->gl_lockref.lock);

do_xmote function needs to be locked before returning,
Otherwise, there will be a double release lock in finish_xmote() function.

Signed-off-by: Wu Bo <wubo40@huawei.com>
---
fs/gfs2/glock.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 29f9b66..7129d10 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -613,6 +613,7 @@ static void do_xmote(struct gfs2_glock *gl, struct gfs2_holder *gh, unsigned int
fs_err(sdp, "Error %d syncing glock \n", ret);
gfs2_dump_glock(NULL, gl, true);
}
+ spin_lock(&gl->gl_lockref.lock);
return;
}
}
--
1.8.3.1
\
 
 \ /
  Last update: 2020-04-28 05:31    [W:0.052 / U:2.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site