public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: liu.song11@zte.com.cn
Cc: jiang.xuexin@zte.com.cn, wang.bo116@zte.com.cn,
	linux-mtd@lists.infradead.org, deng.chao1@zte.com.cn,
	cui.yunfeng@zte.com.cn
Subject: Re: [PATCH]jffs2:bugfix for should not appeared directory hard link
Date: Fri, 13 Feb 2015 10:13:41 +0000	[thread overview]
Message-ID: <1423822421.5969.11.camel@infradead.org> (raw)
In-Reply-To: <OF4EF0DB08.789494F2-ON48257DEB.0016B74A-48257DEB.0016DF0F@zte.com.cn>

[-- Attachment #1: Type: text/plain, Size: 1972 bytes --]

Thank you for the excellent analysis. However, I'm a little confused,
and I'm not sure we're focusing on the right thing.

Step five is to *unlink* the direction /mnt/old. Here's a
carefully-selected citation of your email...

On Fri, 2015-02-13 at 12:09 +0800, liu.song11@zte.com.cn wrote:
> 
> 5. rmdir /mnt/old 
> 6. mkdir /mnt/old 
> 7. goto step 3 
> 
> In this loop, there only /mnt/old's ino number will changed. 
> 
> Before the problem happen, here we print the dirents' info(after step
> 3 and before step4). 
> We can see,/mnt/old/SW1's pino is 71, that means /mnt/old's ino
> number is 71. 
> The dirents all in same eraseblock(0x0e600000 - 0x0e61FFFF). 
> ------------------------------------------------------------- 
 ...
> ino = 71, name = old, version = 299, pino = 1, ofs = 0x0e6186bc 
> ------------------------------------------------------------- 

OK.

> After step5 and before step6, we print the dirents' info. 
...
> ino = 0, name = old, version = 298, pino = 1, ofs = 0x0e6185c4 
> ino = 71, name = old, version = 299, pino = 1, ofs = 0x0e6186bc 
> ---------------------------------------------------------------

That looks wrong. You said you unlinked /mnt/old. But a deletion dirent
appeared *before* the creation, with an *older* version number?

Was that an older deletion dirent from a previous round, and you just
didn't include it in your previous printout (also cited above)? Is the
*new* deletion dirent with version = 300 somewhere else on the flash?

This is the problem, I think.

I don't *care* if the old dirents for <ino#71>/SW1 and <ino#71>/SW2 are
marked as obsolete or not. Because the directory <ino#71> *itself* as
unlinked and should be dead.

If <ino#71> is somehow ending up linked as /mnt/foo again when it should
have been unlinked, *that* is the problem we need to be looking at. The
zombie *children* of <ino#71> are just a symptom of its reincarnation.

-- 
dwmw2

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5745 bytes --]

  reply	other threads:[~2015-02-13 10:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-24  9:26 [PATCH]jffs2:bugfix for should not appeared directory hard link liu.song11
2014-11-05 11:45 ` Brian Norris
2014-11-11  7:12   ` liu.song11
2014-11-12  6:45   ` Liu Song
2014-12-17  1:53     ` Brian Norris
2014-12-17  2:02       ` nick
2015-02-12 13:43 ` David Woodhouse
2015-02-13  4:09   ` liu.song11
2015-02-13 10:13     ` David Woodhouse [this message]
2015-02-13 11:28       ` David Woodhouse
2015-03-12  3:05         ` liu.song11
     [not found] <OF2CCB8417.29770A56-ON48257EE5.0004DBEE-48257EE5.0004E5CC@LocalDomain>
2015-10-26  3:19 ` deng.chao1
2016-02-01 14:21   ` David Woodhouse

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=1423822421.5969.11.camel@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=cui.yunfeng@zte.com.cn \
    --cc=deng.chao1@zte.com.cn \
    --cc=jiang.xuexin@zte.com.cn \
    --cc=linux-mtd@lists.infradead.org \
    --cc=liu.song11@zte.com.cn \
    --cc=wang.bo116@zte.com.cn \
    /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