aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/gfs2/aops.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2020-04-17 08:12:22 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2020-04-17 08:12:22 +0200
commit08d99b2c23dfa84ca5b5e5c194062a0550888b71 (patch)
treef4cf81ba52b375bbafd3b7ee2603b3a4cae7fe30 /fs/gfs2/aops.c
parentdrm: Don't free a struct never allocated by drm_gem_fb_init() (diff)
parentLinux 5.7-rc1 (diff)
downloadwireguard-linux-08d99b2c23dfa84ca5b5e5c194062a0550888b71.tar.xz
wireguard-linux-08d99b2c23dfa84ca5b5e5c194062a0550888b71.zip
Merge drm/drm-next into drm-misc-next
Backmerging required to pull topic/phy-compliance. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Diffstat (limited to 'fs/gfs2/aops.c')
-rw-r--r--fs/gfs2/aops.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index ba83b49ce18c..786c1ce8f030 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -805,11 +805,16 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask)
bd = bh->b_private;
if (bd) {
gfs2_assert_warn(sdp, bd->bd_bh == bh);
- if (!list_empty(&bd->bd_list))
- list_del_init(&bd->bd_list);
bd->bd_bh = NULL;
bh->b_private = NULL;
- kmem_cache_free(gfs2_bufdata_cachep, bd);
+ /*
+ * The bd may still be queued as a revoke, in which
+ * case we must not dequeue nor free it.
+ */
+ if (!bd->bd_blkno && !list_empty(&bd->bd_list))
+ list_del_init(&bd->bd_list);
+ if (list_empty(&bd->bd_list))
+ kmem_cache_free(gfs2_bufdata_cachep, bd);
}
bh = bh->b_this_page;