lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080618183047.GA24400@skywalker>
Date:	Thu, 19 Jun 2008 00:00:47 +0530
From:	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
To:	Eric Sandeen <sandeen@...hat.com>
Cc:	cmm@...ibm.com, tytso@....edu, adilger@....com,
	linux-ext4@...r.kernel.org
Subject: Re: [PATCH] ext4: Fix ext4_bmap to flush the data to the disk with
	delalloc

On Wed, Jun 18, 2008 at 01:03:32PM -0500, Eric Sandeen wrote:
> Aneesh Kumar K.V wrote:
> > With delalloc we don't do block allocation in the write_begin/write_end.
> > So when using bmap we first need to flush data to the disk so that blocks
> > get allocated and then call generic_block_bmap.
> > 
> > Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@...ux.vnet.ibm.com>
> > ---
> >  fs/ext4/inode.c |   11 +++++++++++
> >  1 files changed, 11 insertions(+), 0 deletions(-)
> > 
> > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> > index 7035621..cfeb869 100644
> > --- a/fs/ext4/inode.c
> > +++ b/fs/ext4/inode.c
> > @@ -1833,6 +1833,17 @@ sector_t ext4_bmap(struct address_space *mapping, sector_t block)
> >  	journal_t *journal;
> >  	int err;
> >  
> > +	if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY) &&
> > +			test_opt(inode->i_sb, DELALLOC)) {
> > +		/*
> > +		 * With delalloc we want to sync the file
> > +		 * so that we can make sure we allocate
> > +		 * blocks for file
> > +		 */
> > +		filemap_fdatawrite(mapping);
> > +		filemap_fdatawait(mapping);
> > +	}
> 
> This seems fine.
> 
> I wonder, does it make any sense at all to only do the flushing if the
> block we wish to map is actually in a delalloc state at the moment?
> 

I am not sure it is worth the complexity considering bmap is not a
frequently used API. Initially I was even thinking should i be doing
it only for delalloc. That test seems to be a simple one to put.

-aneesh
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ