Re: [PATCH 4/7] ext4: refactor punch hole code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 26, 2013 at 01:54:19PM +0100, Lukáš Czerner wrote:
> > +	/* Wait all existing dio workers, newcomers will block on i_mutex */
> > +	ext4_inode_block_unlocked_dio(inode);
> 
> This was not present in the indirect punch hole code, does it means
> that there was a bug ? If so maybe it's worth mentioning in the
> description? 

Yes, I'm pretty sure it was a bug.  The
ext4_inode_block_unlocked_dio() call was added in the extents code
path by commit 02d262dffcf4c.  The problem is that i_mutex will not
block DIO readers in dioread_nolock mode.  One of the problems with
not having done the code refactorization earlier was that a bug fixed
in one code path doesn't necessarily get fixed in another.

I'll add a comment to this effect in the commit description.

> > +	if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))
> > +		credits = ext4_writepage_trans_blocks(inode);
> > +	else
> > +		credits = ext4_blocks_for_truncate(inode);
> > +	handle = ext4_journal_start(inode, EXT4_HT_TRUNCATE,
> > +				    ext4_blocks_for_truncate(inode));
> 
> Hmm, shouldn't we be using 'credits' instead of
> ext4_blocks_for_truncate(inode) here ?

Yes, good catch!

Thanks,

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




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux