gfs2: Wait for gfs2_qd_dealloc() before freeing sbd
PATCH 1/1 gfs2: Wait for gfs2_qd_dealloc() before freeing sbd
gfs2_qd_dealloc() is called asynchronously with call_rcu() in gfs2_qd_dispose(). It uses the sbd so it can race with the sbd being freed on unmount. Add an rcu_barrier() to free_sbd() to make sure it completes before the sbd is freed.
Reported-by [email protected]
Signed-off-by Andrew Price <[email protected]>
--- fs/gfs2/ops_fstype.c | 2 ++ 1 file changed, 2 insertions(+)
fs/gfs2/ops_fstype.c +2 -0
@@ -66,6 +66,8 @@ void free_sbd(struct gfs2_sbd *sdp) {struct super_block *sb = sdp->sd_vfs; +/* Wait for rcu_call(gfs2_qd_dealloc) */ +rcu_barrier ();free_percpu (sdp->sd_lkstats); sb->s_fs_info =NULL ;kfree (sdp);
Signature · 1 line
2.50.1