public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Chinner <dgc@sgi.com>
To: Lachlan McIlroy <lachlan@sgi.com>
Cc: David Chinner <dgc@sgi.com>, xfs-dev@sgi.com, xfs@oss.sgi.com
Subject: Re: Review: Clear unwritten flag on during partial page truncation
Date: Wed, 20 Dec 2006 20:07:18 +1100	[thread overview]
Message-ID: <20061220090718.GY44411608@melbourne.sgi.com> (raw)
In-Reply-To: <4588F2A2.4000609@sgi.com>

On Wed, Dec 20, 2006 at 08:21:54AM +0000, Lachlan McIlroy wrote:
> @@ -41,6 +41,8 @@
>  #include <linux/pagevec.h>
>  #include <linux/writeback.h>
> 
> +STATIC void xfs_vm_invalidatepage(struct page *, unsigned long);
> +
>  STATIC void
>  xfs_count_page_state(
>  	struct page		*page,
> @@ -1061,7 +1063,7 @@ error:
>  	 */
>  	if (err != -EAGAIN) {
>  		if (!unmapped)
> -			block_invalidatepage(page, 0);
> +			xfs_vm_invalidatepage(page, 0);
> 
> We pass in an offset of zero here...

Yup - to invalidate the whole page.

> @@ -1458,6 +1468,32 @@ xfs_vm_invalidatepage(
>  {
>  	xfs_page_trace(XFS_INVALIDPAGE_ENTER,
>  			page->mapping->host, page, offset);
> +
> +	/*
> +	 * Need to clear private flags from buffers on partial
> +	 * page truncations ourselves. Same inner loop as
> +	 * block_invalidatepage() is used.
> +	 */
> +	if (offset && page_has_buffers(page)) {
> 
> And only do this code for non-zero offsets.  Are you sure this is correct?

Yes. offset == 0 will currently just fall through to
block_invalidatepage() which removes and frees all the buffers.
Right now that first change is a no-op except on debug kernels we'll
get a trace entry to indicate that we invalidated the page.

In future, however, we may need to scan all the buffers before
freeing them, so now we'll only need to modify xfs_vm_invalidatepage()....

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group

  reply	other threads:[~2006-12-20  9:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-20  6:28 Review: Clear unwritten flag on during partial page truncation David Chinner
2006-12-20  8:21 ` Lachlan McIlroy
2006-12-20  9:07   ` David Chinner [this message]
2006-12-21  6:16 ` Nathan Scott
2006-12-21 11:37   ` David Chinner
2006-12-21 22:04     ` Nathan Scott
2006-12-22 13:21   ` Christoph Hellwig
2006-12-23  2:55     ` David Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061220090718.GY44411608@melbourne.sgi.com \
    --to=dgc@sgi.com \
    --cc=lachlan@sgi.com \
    --cc=xfs-dev@sgi.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox