linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: linux-fsdevel@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>, Jan Kara <jack@suse.cz>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org
Subject: Re: [rfc][patch 3/3] fs: convert ext2,tmpfs to new truncate
Date: Tue, 7 Jul 2009 15:30:14 +0200	[thread overview]
Message-ID: <20090707133014.GA2714@wotan.suse.de> (raw)
In-Reply-To: <4A533559.90303@panasas.com>

On Tue, Jul 07, 2009 at 02:45:29PM +0300, Boaz Harrosh wrote:
> On 07/06/2009 07:56 PM, Nick Piggin wrote:
> > Convert filemap_xip.c, buffer.c, and some filesystems to the new truncate
> > convention. Converting generic helpers is using some ugly code (testing
> > for i_op->ftruncate) to distinguish new and old callers... better
> > alternative might be just define a new function for these guys.
> > @@ -770,13 +793,22 @@ ext2_nobh_write_begin(struct file *file,
> >  		loff_t pos, unsigned len, unsigned flags,
> >  		struct page **pagep, void **fsdata)
> >  {
> > +	int ret;
> > +
> >  	/*
> >  	 * Dir-in-pagecache still uses ext2_write_begin. Would have to rework
> >  	 * directory handling code to pass around offsets rather than struct
> >  	 * pages in order to make this work easily.
> >  	 */
> > -	return nobh_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
> > +	ret = nobh_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
> >  							ext2_get_block);
> > +	if (ret < 0) {
> > +		loff_t isize;
> > +		isize = i_size_read(inode);
> 
> Unlike the other places you use i_size_read() here, please explain what is the
> locking rules for this?
> 
> Did your patchset change things in this regard?

i_mutex should protect i_size. I was doing a bit of cutting and pasting
so it probably isn't perfect. I'll double check.


--
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>

  reply	other threads:[~2009-07-07 13:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-06 16:54 [rfc][patch 1/3] fs: new truncate sequence Nick Piggin
2009-07-06 16:55 ` [rfc][patch 2/3] fs: make use of new helper functions Nick Piggin
2009-07-06 17:23   ` Christoph Hellwig
2009-07-06 17:47     ` Nick Piggin
2009-07-06 18:05   ` Miklos Szeredi
2009-07-06 16:56 ` [rfc][patch 3/3] fs: convert ext2,tmpfs to new truncate Nick Piggin
2009-07-06 17:28   ` Christoph Hellwig
2009-07-06 17:59     ` Nick Piggin
2009-07-07  9:17     ` Nick Piggin
2009-07-07 11:45   ` Boaz Harrosh
2009-07-07 13:30     ` Nick Piggin [this message]
2009-07-06 17:22 ` [rfc][patch 1/3] fs: new truncate sequence Christoph Hellwig
2009-07-06 17:47   ` Nick Piggin
2009-07-07  7:29     ` Peter Zijlstra
2009-07-07  8:48       ` Nick Piggin
2009-07-06 18:00 ` Miklos Szeredi
2009-07-06 18:10   ` Nick Piggin
2009-07-07 11:45 ` Boaz Harrosh
2009-08-15 14:51 ` Christoph Hellwig
2009-08-15 15:14   ` Nick Piggin
2009-08-15 15:18     ` Christoph Hellwig
2009-08-15 15:36       ` Nick Piggin

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=20090707133014.GA2714@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=bharrosh@panasas.com \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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).