From: David Chinner <dgc@sgi.com>
To: Chris Mason <chris.mason@oracle.com>
Cc: David Chinner <dgc@sgi.com>, Hugh Dickins <hugh@veritas.com>,
xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH 1 of 2] Implement generic block_page_mkwrite() functionality
Date: Fri, 9 Feb 2007 09:30:58 +1100 [thread overview]
Message-ID: <20070208223058.GV44411608@melbourne.sgi.com> (raw)
In-Reply-To: <20070208131100.GH11967@think.oraclecorp.com>
On Thu, Feb 08, 2007 at 08:11:00AM -0500, Chris Mason wrote:
> On Thu, Feb 08, 2007 at 09:50:13AM +1100, David Chinner wrote:
> > > You don't need to lock out all truncation, but you do need to lock
> > > out truncation of the page in question. Instead of your i_size
> > > checks, check page->mapping isn't NULL after the lock_page?
> >
> > Yes, that can be done, but we still need to know if part of
> > the page is beyond EOF for when we call block_commit_write()
> > and mark buffers dirty. Hence we need to check the inode size.
> >
> > I guess if we block the truncate with the page lock, then the
> > inode size is not going to change until we unlock the page.
> > If the inode size has already been changed but the page not yet
> > removed from the mapping we'll be beyond EOF.
> >
> > So it seems to me that we can get away with not using the i_mutex
> > in the generic code here.
>
> vmtruncate changes the inode size before waiting on any pages. So,
> i_size could change any time during page_mkwrite.
Which would put us beyond EOF. Ok.
> It would be a good idea to read i_size once and put it in a local var
> instead.
Will do - I'll snap it once the page is locked....
Thanks Chris.
Cheers,
Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2007-02-08 22:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-07 12:49 David Chinner
2007-02-07 12:55 ` David Chinner
2007-02-07 13:00 ` Hugh Dickins
2007-02-07 14:44 ` David Chinner
2007-02-07 15:52 ` Chris Mason
2007-02-08 2:34 ` Nick Piggin
2007-02-07 15:56 ` Hugh Dickins
2007-02-07 22:50 ` David Chinner
2007-02-08 13:11 ` Chris Mason
2007-02-08 22:30 ` David Chinner [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=20070208223058.GV44411608@melbourne.sgi.com \
--to=dgc@sgi.com \
--cc=chris.mason@oracle.com \
--cc=hugh@veritas.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--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