xfs
[Top] [All Lists]

Re: [PATCH 03/10] xfs: a few small tweaks for overwrites in xfs_vm_write

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 03/10] xfs: a few small tweaks for overwrites in xfs_vm_writepage
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 1 Dec 2010 15:07:04 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20101122130903.533699161@xxxxxxxxxxxxxxxxxxxxxx>
References: <20101122130506.868076797@xxxxxxxxxxxxxxxxxxxxxx> <20101122130903.533699161@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Mon, Nov 22, 2010 at 08:05:09AM -0500, Christoph Hellwig wrote:
> Don't trylock the buffer.  We are the only one ever locking it for
> a regular file address space, and trylock was only copied from the
> generic code which did it due to the old buffer based writeout in
> jbd.  Also make sure to only write out the buffer if the iomap
> actually is valid, because we wouldn't have a proper mapping
> otherwise.  In practice we will never get an invalid mapping here
> as the page lock guarantees truncate doesn't race with us, but
> better be safe than sorry.  Also make sure we allocate a new ioend
> when crossing boundaries between mappings, just like we do for
> delalloc and unwritten extents.  Again this currently doesn't
> matter as the I/O end handler only cares for the boundaries for
> unwritten extents, but this makes the code fully correct and the
> same as for delalloc/unwritten extents.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>