From patchwork Tue Mar 4 13:56:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 326305 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id CD69B2C00B1 for ; Wed, 5 Mar 2014 00:56:37 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757296AbaCDN4g (ORCPT ); Tue, 4 Mar 2014 08:56:36 -0500 Received: from imap.thunk.org ([74.207.234.97]:36833 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757292AbaCDN4f (ORCPT ); Tue, 4 Mar 2014 08:56:35 -0500 Received: from root (helo=closure.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.80) (envelope-from ) id 1WKppb-0004uf-NE; Tue, 04 Mar 2014 13:56:27 +0000 Received: by closure.thunk.org (Postfix, from userid 15806) id 6BA955801E5; Tue, 4 Mar 2014 08:56:24 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=thunk.org; s=mail; t=1393941384; bh=4kRqp19Ci6qGN10UTTJPFUdPMYnfqtNJSyWBZZDvayI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LirbVSN3JCIFLRvlEq4SGeXRDnEaPdNvjJilGhix83aNk2K9pEOcKtIsq180J8mZH aCkLLWp2PLYCV47i8T5qLkxUO1CMe9J4WJM4vFvkU11ifZsW9ggxojMYn/eZDpXyvi HL+OMcatEQ2+WDeDCXndAGCRqjfg9dlqX4VXFKAM= Date: Tue, 4 Mar 2014 08:56:24 -0500 From: Theodore Ts'o To: "Darrick J. Wong" Cc: Zheng Liu , linux-ext4@vger.kernel.org, Zheng Liu Subject: Re: [PATCH v3 11/30] libext2fs: handle inline data in dir iterator function Message-ID: <20140304135624.GA18385@thunk.org> References: <1386323897-2354-1-git-send-email-wenqing.lz@taobao.com> <1386323897-2354-12-git-send-email-wenqing.lz@taobao.com> <20140303221653.GA4452@thunk.org> <20140303233154.GB9875@birch.djwong.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140303233154.GB9875@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.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. > 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;