[Ocfs2-tools-devel] [PATCH 5/6] Resend: Add unwritten extent support in ocfs2-tools, take 2

Joel Becker Joel.Becker at oracle.com
Wed Sep 26 16:56:11 PDT 2007


On Wed, Sep 26, 2007 at 04:12:44PM -0700, Mark Fasheh wrote:
> > @@ -2251,6 +3698,7 @@ errcode_t ocfs2_extend_allocation(ocfs2_filesys *fs, uint64_t ino,
> >  	uint64_t blkno, file_size;
> >  	char *buf = NULL;
> >  	struct ocfs2_dinode* di = NULL;
> > +	uint16_t flag = 0;
> >  
> >  	if (!(fs->fs_flags & OCFS2_FLAG_RW))
> >  		return OCFS2_ET_RO_FILESYS;
> > @@ -2265,6 +3713,9 @@ errcode_t ocfs2_extend_allocation(ocfs2_filesys *fs, uint64_t ino,
> >  
> >  	di = (struct ocfs2_dinode *)buf;
> >  
> > +	if (ocfs2_writes_unwritten_extents(OCFS2_RAW_SB(fs->fs_super)))
> > +		flag = OCFS2_EXT_UNWRITTEN;
> 
> Uh-oh... Doesn't this function get called for expanding dirs and creating
> journals?
> 
> It's illegal (and pointless anyway) for a directory or a journal to have an
> unwritten extent.

	This brings up another issue.  In your sixth patch, you modify
file_read() and file_write() to handle unwritten extents.  However,
anyone using ocfs2_block_iterate() or ocfs2_extent_iterate() needs to
understand unwritten extents.  They can, of course, see them on the
rec->flags, but we need to make sure all users handle this.  It would be
slicker if we can handle it for them, but that might take more work :-)

Joel

-- 

"Glory is fleeting, but obscurity is forever."  
         - Napoleon Bonaparte

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list