All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH] gfs2: Remove dirty buffer warning from gfs2_releasepage
@ 2016-08-18 13:41 Andreas Gruenbacher
  2016-08-18 15:32 ` Bob Peterson
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Gruenbacher @ 2016-08-18 13:41 UTC (permalink / raw)
  To: cluster-devel.redhat.com

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>
---
 fs/gfs2/aops.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 82df368..d17bf16 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)
 	if (!page_has_buffers(page))
 		return 0;
 
+	/*
+	 * From xfs_vm_releasepage: mm accommodates an old ext3 case where
+	 * clean pages might not have had the dirty bit cleared.  Thus, it can
+	 * send actual dirty pages to ->releasepage() via shrink_active_list().
+	 *
+	 * As a workaround, we skip pages that contain dirty buffers below.
+	 * Once ->releasepage isn't called on dirty pages anymore, we can warn
+	 * on dirty buffers like we used to here again.
+	 */
+
 	gfs2_log_lock(sdp);
 	spin_lock(&sdp->sd_ail_lock);
 	head = bh = page_buffers(page);
@@ -1156,8 +1166,8 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask)
 		bd = bh->b_private;
 		if (bd && bd->bd_tr)
 			goto cannot_release;
-		if (buffer_pinned(bh) || buffer_dirty(bh))
-			goto not_possible;
+		if (buffer_dirty(bh) || WARN_ON(buffer_pinned(bh)))
+			goto cannot_release;
 		bh = bh->b_this_page;
 	} while(bh != head);
 	spin_unlock(&sdp->sd_ail_lock);
@@ -1180,9 +1190,6 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask)
 
 	return try_to_free_buffers(page);
 
-not_possible: /* Should never happen */
-	WARN_ON(buffer_dirty(bh));
-	WARN_ON(buffer_pinned(bh));
 cannot_release:
 	spin_unlock(&sdp->sd_ail_lock);
 	gfs2_log_unlock(sdp);
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Cluster-devel] [PATCH] gfs2: Remove dirty buffer warning from gfs2_releasepage
  2016-08-18 13:41 [Cluster-devel] [PATCH] gfs2: Remove dirty buffer warning from gfs2_releasepage Andreas Gruenbacher
@ 2016-08-18 15:32 ` Bob Peterson
  0 siblings, 0 replies; 2+ messages in thread
From: Bob Peterson @ 2016-08-18 15:32 UTC (permalink / raw)
  To: cluster-devel.redhat.com

----- Original Message -----
| 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>
| ---
Hi,

Thanks. This is now applied to the for-next branch of the linux-gfs2 tree:
https://git.kernel.org/cgit/linux/kernel/git/gfs2/linux-gfs2.git/commit/fs/gfs2?h=for-next&id=1c185c02f454c47d573a17e3e7d8befb06f0d64d

Regards,

Bob Peterson
Red Hat File Systems



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-18 15:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-18 13:41 [Cluster-devel] [PATCH] gfs2: Remove dirty buffer warning from gfs2_releasepage Andreas Gruenbacher
2016-08-18 15:32 ` Bob Peterson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.