linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Zheng Liu <gnehzuil.liu@gmail.com>,
	linux-ext4@vger.kernel.org, Zheng Liu <wenqing.lz@taobao.com>
Subject: Re: [PATCH v3 11/30] libext2fs: handle inline data in dir iterator function
Date: Tue, 4 Mar 2014 08:56:24 -0500	[thread overview]
Message-ID: <20140304135624.GA18385@thunk.org> (raw)
In-Reply-To: <20140303233154.GB9875@birch.djwong.org>

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

  reply	other threads:[~2014-03-04 13:56 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-06  9:57 [PATCH v3 00/30] e2fsprogs: inline data refinement patch set Zheng Liu
2013-12-06  9:57 ` [PATCH v3 01/30] libext2fs: support modifying arbitrary extended attributes Zheng Liu
2013-12-06  9:57 ` [PATCH v3 02/30] libext2fs: various tweaks to the xattr editor APIs Zheng Liu
2013-12-06  9:57 ` [PATCH v3 03/30] libext2fs: extend xattr api to query number of attrs Zheng Liu
2013-12-06  9:57 ` [PATCH v3 04/30] libext2fs: fix memory leaks in extended attribute code Zheng Liu
2013-12-06  9:57 ` [PATCH v3 05/30] libext2fs: fix block leak when releasing xattr block Zheng Liu
2013-12-06  9:57 ` [PATCH v3 06/30] libext2fs: remove redundant code Zheng Liu
2013-12-06  9:57 ` [PATCH v3 07/30] libext2fs: free key/value pairs before reading Zheng Liu
2013-12-06  9:57 ` [PATCH v3 08/30] debugfs: dump all extended attributes Zheng Liu
2013-12-06  9:57 ` [PATCH v3 09/30] libext2fs: check inline_data in ext2fs_xattrs_read/write Zheng Liu
2013-12-06 21:38   ` Darrick J. Wong
2013-12-07  3:45     ` Zheng Liu
2014-03-03 23:33       ` Darrick J. Wong
2013-12-06  9:57 ` [PATCH v3 10/30] libext2fs: define new dirent_swab interfaces for inline data Zheng Liu
2014-03-03 15:49   ` Theodore Ts'o
2014-03-13 16:32     ` jon ernst
2014-03-14  2:44       ` Theodore Ts'o
2013-12-06  9:57 ` [PATCH v3 11/30] libext2fs: handle inline data in dir iterator function Zheng Liu
2014-03-03 22:16   ` Theodore Ts'o
2014-03-03 23:31     ` Darrick J. Wong
2014-03-04 13:56       ` Theodore Ts'o [this message]
2014-03-04  4:48     ` Zheng Liu
2013-12-06  9:57 ` [PATCH v3 12/30] libext2fs: handle inline_data in block " Zheng Liu
2013-12-06  9:58 ` [PATCH v3 13/30] debugfs: make stat command support inline data Zheng Liu
2013-12-06  9:58 ` [PATCH v3 14/30] debugfs: make expand " Zheng Liu
2013-12-06  9:58 ` [PATCH v3 15/30] debugfs: make mkdir " Zheng Liu
2013-12-06  9:58 ` [PATCH v3 16/30] debugfs: make lsdel " Zheng Liu
2013-12-06  9:58 ` [PATCH v3 17/30] debugfs: handle inline_data feature in bmap command Zheng Liu
2013-12-06  9:58 ` [PATCH v3 18/30] debugfs: handle inline data feature in punch command Zheng Liu
2013-12-06  9:58 ` [PATCH v3 19/30] libext2fs: handle inline data in read/write function Zheng Liu
2014-03-03 23:57   ` Darrick J. Wong
2013-12-06  9:58 ` [PATCH v3 20/30] libext2fs: add inline_data feature into EXT2_LIB_FEATURE_INCOMPAT_SUPP Zheng Liu
2013-12-06  9:58 ` [PATCH v3 21/30] mke2fs: add inline_data support in mke2fs Zheng Liu
2013-12-06  9:58 ` [PATCH v3 22/30] tune2fs: add inline_data feature in tune2fs Zheng Liu
2013-12-10 21:06   ` Darrick J. Wong
2013-12-06  9:58 ` [PATCH v3 23/30] e2fsck: add problem descriptions and check inline data feature Zheng Liu
2013-12-06  9:58 ` [PATCH v3 24/30] e2fsck: check inline_data in pass1 Zheng Liu
2014-03-03 22:18   ` Theodore Ts'o
2014-03-04  4:51     ` Zheng Liu
2013-12-06  9:58 ` [PATCH v3 25/30] e2fsck: check inline_data in pass2 Zheng Liu
2013-12-06  9:58 ` [PATCH v3 26/30] e2fsck: check inline_data in pass3 Zheng Liu
2013-12-06  9:58 ` [PATCH v3 27/30] tests: change result in f_bad_disconnected_inode Zheng Liu
2013-12-06  9:58 ` [PATCH v3 28/30] mke2fs: enable inline_data feature on ext4dev filesystem Zheng Liu
2013-12-06  9:58 ` [PATCH v3 29/30] libext2fs: export inode cahce creation function Zheng Liu
2013-12-06  9:58 ` [PATCH v3 30/30] libext2fs: add a unit test for inline data Zheng Liu
2013-12-07  1:53 ` [PATCH v3 00/30] e2fsprogs: inline data refinement patch set Darrick J. Wong
2013-12-07  3:43   ` Zheng Liu
  -- strict thread matches above, loose matches on Subject: below --
2014-03-06 16:31 [PATCH v3 11/30] libext2fs: handle inline data in dir iterator function Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140304135624.GA18385@thunk.org \
    --to=tytso@mit.edu \
    --cc=darrick.wong@oracle.com \
    --cc=gnehzuil.liu@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=wenqing.lz@taobao.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).