From patchwork Mon Apr 19 13:03:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 50466 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A494FB7CF6 for ; Mon, 19 Apr 2010 23:05:31 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1O3qdS-0003dd-K2; Mon, 19 Apr 2010 13:03:34 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1O3qdP-0003dT-CV for linux-mtd@bombadil.infradead.org; Mon, 19 Apr 2010 13:03:31 +0000 Received: from [2001:8b0:10b:1:222:41ff:fe2d:310a] by casper.infradead.org with esmtpsa (Exim 4.69 #1 (Red Hat Linux)) id 1O3qdN-0000AA-1z; Mon, 19 Apr 2010 13:03:29 +0000 Subject: Re: [PATCH 11/35] whiteout: jffs2 whiteout support From: David Woodhouse To: Valerie Aurora In-Reply-To: <1271372682-21225-12-git-send-email-vaurora@redhat.com> References: <1271372682-21225-1-git-send-email-vaurora@redhat.com> <1271372682-21225-2-git-send-email-vaurora@redhat.com> <1271372682-21225-3-git-send-email-vaurora@redhat.com> <1271372682-21225-4-git-send-email-vaurora@redhat.com> <1271372682-21225-5-git-send-email-vaurora@redhat.com> <1271372682-21225-6-git-send-email-vaurora@redhat.com> <1271372682-21225-7-git-send-email-vaurora@redhat.com> <1271372682-21225-8-git-send-email-vaurora@redhat.com> <1271372682-21225-9-git-send-email-vaurora@redhat.com> <1271372682-21225-10-git-send-email-vaurora@redhat.com> <1271372682-21225-11-git-send-email-vaurora@redhat.com> <1271372682-21225-12-git-send-email-vaurora@redhat.com> Date: Mon, 19 Apr 2010 14:03:27 +0100 Message-ID: <1271682207.14748.719.camel@macbook.infradead.org> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 (2.28.3-1.fc12) X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org See http://www.infradead.org/rpr.html Cc: linux-fsdevel@vger.kernel.org, Felix Fietkau , linux-mtd@lists.infradead.org, Alexander Viro , linux-kernel@vger.kernel.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org On Thu, 2010-04-15 at 16:04 -0700, Valerie Aurora wrote: > From: Felix Fietkau > > Add support for whiteout dentries to jffs2. This doesn't seem to have incorporated my feedback from the attached... diff --git a/fs/jffs2/build.c b/fs/jffs2/build.c index c5e1450..4dc883f 100644 --- a/fs/jffs2/build.c +++ b/fs/jffs2/build.c @@ -217,8 +217,9 @@ static void jffs2_build_remove_unlinked_inode(struct jffs2_sb_info *c, ic->scan_dents = fd->next; if (!fd->ino) { - /* It's a deletion dirent. Ignore it */ - dbg_fsbuild("child \"%s\" is a deletion dirent, skipping...\n", fd->name); + dbg_fsbuild("child \"%s\" is a %s, skipping...\n", + fd->name, + (fd->type == DT_WHT)?"whiteout":"deletion dirent"); jffs2_free_full_dirent(fd); continue; } diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c index 090c556..7f5afbb 100644 --- a/fs/jffs2/gc.c +++ b/fs/jffs2/gc.c @@ -516,7 +516,7 @@ static int jffs2_garbage_collect_live(struct jffs2_sb_info *c, struct jffs2_era break; } - if (fd && fd->ino) { + if (fd && (fd->ino || fd->type == DT_WHT)) { ret = jffs2_garbage_collect_dirent(c, jeb, f, fd); } else if (fd) { ret = jffs2_garbage_collect_deletion_dirent(c, jeb, f, fd); @@ -895,7 +895,7 @@ static int jffs2_garbage_collect_deletion_dirent(struct jffs2_sb_info *c, struct continue; /* If the name length doesn't match, or it's another deletion dirent, skip */ - if (rd->nsize != name_len || !je32_to_cpu(rd->ino)) + if (rd->nsize != name_len || (!je32_to_cpu(rd->ino) && rd->type != DT_WHT)) continue; /* OK, check the actual name now */ diff --git a/fs/jffs2/write.c b/fs/jffs2/write.c index ca29440..bcd4b86 100644 --- a/fs/jffs2/write.c +++ b/fs/jffs2/write.c @@ -629,8 +629,9 @@ int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, printk(KERN_WARNING "Deleting inode #%u with active dentry \"%s\"->ino #%u\n", dead_f->inocache->ino, fd->name, fd->ino); } else { - D1(printk(KERN_DEBUG "Removing deletion dirent for \"%s\" from dir ino #%u\n", - fd->name, dead_f->inocache->ino)); + D1(printk(KERN_DEBUG "Removing %s for \"%s\" from dir ino #%u\n", + (fd->type == DT_WHT)?"whiteout":"deletion dirent", + fd->name, dead_f->inocache->ino)); } if (fd->raw) jffs2_mark_node_obsolete(c, fd->raw);