linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: Wendy Cheng <wcheng@redhat.com>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 04/16] GFS2: Daemons and address space operations
Date: Tue, 02 May 2006 13:43:06 +0100	[thread overview]
Message-ID: <1146573786.3856.281.camel@quoit.chygwyn.com> (raw)
In-Reply-To: <44565ABC.6080301@redhat.com>

Hi,

On Mon, 2006-05-01 at 15:00 -0400, Wendy Cheng wrote:
> Steven Whitehouse wrote
> 
> >+static int gfs2_writepage(struct page *page, struct writeback_control *wbc)
> >+{
> >+	struct inode *inode = page->mapping->host;
> >+	struct gfs2_inode *ip = page->mapping->host->u.generic_ip;
> >+	struct gfs2_sbd *sdp = ip->i_sbd;
> >+	loff_t i_size = i_size_read(inode);
> >+	pgoff_t end_index = i_size >> PAGE_CACHE_SHIFT;
> >+	unsigned offset;
> >+	int error;
> >+	int done_trans = 0;
> >+
> >+	if (gfs2_assert_withdraw(sdp, gfs2_glock_is_held_excl(ip->i_gl))) {
> >+		unlock_page(page);
> >+		return -EIO;
> >+	}
> >+	if (current->journal_info)
> >+		goto out_ignore;
> >+
> >+	/* Is the page fully outside i_size? (truncate in progress) */
> >+        offset = i_size & (PAGE_CACHE_SIZE-1);
> >+	if (page->index >= end_index+1 || !offset) {
> >+		page->mapping->a_ops->invalidatepage(page, 0);
> >+		unlock_page(page);
> >+		return 0; /* don't care */
> >+	}
> >
> >  
> >
> Will above "|| !offset" unconditionally drop the page if the file size 
> happens to be multiples of PAGE_CACHE_SIZE ?  Maybe this truncate 
> handling should be removed to let block_write_full_page() handle all the 
> cases ?
> 
This test was incorrectly borrowed from block_write_full_page in order
that we would avoid having to start a transaction, or add buffers to
pages, in case the page had already been truncated. I've just pushed a
patch to fix this:

http://www.kernel.org/git/?p=linux/kernel/git/steve/gfs2-2.6.git;a=commitdiff;h=d2d7b8a2a756fb520792ca3db3abdeed9214ae5b

Steve.



      reply	other threads:[~2006-05-02 12:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-21 16:12 [PATCH 04/16] GFS2: Daemons and address space operations Steven Whitehouse
2006-05-01 19:00 ` Wendy Cheng
2006-05-02 12:43   ` Steven Whitehouse [this message]

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=1146573786.3856.281.camel@quoit.chygwyn.com \
    --to=swhiteho@redhat.com \
    --cc=akpm@osdl.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wcheng@redhat.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;
as well as URLs for NNTP newsgroup(s).