Re: [PATCH v3 11/30] libext2fs: handle inline data in dir iterator function

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

 



On Mon, Mar 03, 2014 at 03:31:54PM -0800, Darrick J. Wong wrote:
> > diff --git a/lib/ext2fs/dir_iterate.c b/lib/ext2fs/dir_iterate.c
> > index 6bdfae5..8afccbe 100644
> > --- a/lib/ext2fs/dir_iterate.c
> > +++ b/lib/ext2fs/dir_iterate.c
> > @@ -129,9 +129,7 @@ errcode_t ext2fs_dir_iterate2(ext2_filsys fs,
> >  		ext2fs_free_mem(&ctx.buf);
> >  	if (retval == EXT2_ET_INLINE_DATA_CANT_ITERATE) {
> >  		ctx.flags |= DIRENT_FLAG_INCLUDE_INLINE_DATA;
> > -		retval = ext2fs_inline_data_dir_iterate(fs, dir,
> > -						ext2fs_process_dir_block,
> > -						&ctx);
> > +		(void) ext2fs_inline_data_dir_iterate(fs, dir, &ctx);
> >  	}
> >  	if (retval)
> >  		return retval;
> 
> Hmm.  In order to get into ext2fs_inline_data_dir_iterate(), it has to be the
> case that retval == EXT2_ET_INLINE_DATA_CANT_ITERATE.  But then we immediately
> return that error code, which means that anything interesting in ctx.errcode
> will be lost.  I /think/ you want to set retval = 0 in that if clause?

Yes, I noticed this morning that it caused a regression test failure
(which is comforting from a code coverage point of view :-).  I've
made that change.

> 
> Was BLOCK_INLINE_DATA_CHANGED ever cleared from retval?  As written, I /think/
> that writing either dot or dotdot entries will result in the EA being written
> too, even if nothing changes there.

Yes, good point.  I've added the following change.

diff --git a/lib/ext2fs/inline_data.c b/lib/ext2fs/inline_data.c
index db1bc03..9bfc8ef 100644
--- a/lib/ext2fs/inline_data.c
+++ b/lib/ext2fs/inline_data.c
@@ -133,6 +133,7 @@ int ext2fs_inline_data_dir_iterate(ext2_filsys fs, ext2_ino_t ino,
 		err = ext2fs_write_inode(fs, ino, &inode);
 		if (err)
 			goto out;
+		ret &= ~BLOCK_INLINE_DATA_CHANGED;
 	}
 	if (ret & BLOCK_ABORT)
 		goto out;
@@ -159,6 +160,7 @@ int ext2fs_inline_data_dir_iterate(ext2_filsys fs, ext2_ino_t ino,
 		ctx->errcode = ext2fs_write_inode(fs, ino, &inode);
 		if (ctx->errcode)
 			ret |= BLOCK_ABORT;
+		ret &= ~BLOCK_INLINE_DATA_CHANGED;
 	}
 	if (ret & BLOCK_ABORT)
 		goto out;
     	  	       
> Guess I'll have a look at the other patches too.

I've updated the pu branch with the inline data patches, so if you and
Zheng could take a look at it and sanity check it, I'd really
appreicate it.  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