summaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2016-08-18 09:57:04 -0400
committerBob Peterson <rpeterso@redhat.com>2016-08-18 09:57:04 -0400
commit1c185c02f454c47d573a17e3e7d8befb06f0d64d (patch)
treedfd9e3b7191ed945e2a935933616eaf7c1c8c4a3 /fs/gfs2
parent47a9a527946842dd8d83d4c8c8be22b2615b65f5 (diff)
gfs2: Remove dirty buffer warning from gfs2_releasepage
Unlike what its documentation suggests, the releasepage address space operation can currently be called on dirty pages via shrink_active_list. This may eventually be changed when the remaining code relying on the current behavior has been fixed, but until then, it makes no sense to warn on dirty buffers in gfs2_releasepage. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/aops.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 71dbbd4a2324..5a6f52ea2722 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -1147,6 +1147,16 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask)
1147 if (!page_has_buffers(page)) 1147 if (!page_has_buffers(page))
1148 return 0; 1148 return 0;
1149 1149
1150 /*
1151 * From xfs_vm_releasepage: mm accommodates an old ext3 case where
1152 * clean pages might not have had the dirty bit cleared. Thus, it can
1153 * send actual dirty pages to ->releasepage() via shrink_active_list().
1154 *
1155 * As a workaround, we skip pages that contain dirty buffers below.
1156 * Once ->releasepage isn't called on dirty pages anymore, we can warn
1157 * on dirty buffers like we used to here again.
1158 */
1159
1150 gfs2_log_lock(sdp); 1160 gfs2_log_lock(sdp);
1151 spin_lock(&sdp->sd_ail_lock); 1161 spin_lock(&sdp->sd_ail_lock);
1152 head = bh = page_buffers(page); 1162 head = bh = page_buffers(page);
@@ -1156,8 +1166,8 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask)
1156 bd = bh->b_private; 1166 bd = bh->b_private;
1157 if (bd && bd->bd_tr) 1167 if (bd && bd->bd_tr)
1158 goto cannot_release; 1168 goto cannot_release;
1159 if (buffer_pinned(bh) || buffer_dirty(bh)) 1169 if (buffer_dirty(bh) || WARN_ON(buffer_pinned(bh)))
1160 goto not_possible; 1170 goto cannot_release;
1161 bh = bh->b_this_page; 1171 bh = bh->b_this_page;
1162 } while(bh != head); 1172 } while(bh != head);
1163 spin_unlock(&sdp->sd_ail_lock); 1173 spin_unlock(&sdp->sd_ail_lock);
@@ -1180,9 +1190,6 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask)
1180 1190
1181 return try_to_free_buffers(page); 1191 return try_to_free_buffers(page);
1182 1192
1183not_possible: /* Should never happen */
1184 WARN_ON(buffer_dirty(bh));
1185 WARN_ON(buffer_pinned(bh));
1186cannot_release: 1193cannot_release:
1187 spin_unlock(&sdp->sd_ail_lock); 1194 spin_unlock(&sdp->sd_ail_lock);
1188 gfs2_log_unlock(sdp); 1195 gfs2_log_unlock(sdp);