Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>,
	"yuyufen@huawei.com" <yuyufen@huawei.com>
Cc: "viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH] jffs2: remove fd from the f->dents list immediately.
Date: Fri, 16 Mar 2018 12:52:47 +0000	[thread overview]
Message-ID: <1521204767.20126.123.camel@infradead.org> (raw)
In-Reply-To: <1521203963.4790.208.camel@infinera.com>

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

On Fri, 2018-03-16 at 12:39 +0000, Joakim Tjernlund wrote:
> 
> > After reverting the commit, we test 'rm -r', which can remove all
> > files, and all seems OK!
> 
> UHH, this is mine (and Davids work from 2007)!
> I cannot remember  any details this long afterwards but I guess you cannot just
> revert that part as it triggers some other bug, David?

Right, the issue was with f_pos in the directory.

The 'rm' we were testing with at the time would delete a bunch of
directory entries, then continue with its readdir() to work out what
else to delete. But when we were handling f_pos on directories merely
as the position on the list, and when we were *deleting* things from
that list as we went, some dirents ended up moving so that they were
*before* the position that 'rm' had got to with its readdir().

But... the list we're traversing is *already* ordered by CRC, and that
could be a much saner thing to use as f_pos. We just have to make sure
we cope with hash collisions. Shifting left by 4 bits and using the low
4 bits would allow us to cope with 16 names with the same hash... but
I'm not sure that's good enough.

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

  reply	other threads:[~2018-03-16 12:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16 11:05 [PATCH] jffs2: remove fd from the f->dents list immediately Yufen Yu
2018-03-16 12:39 ` Joakim Tjernlund
2018-03-16 12:52   ` David Woodhouse [this message]
2018-03-19  8:27     ` yuyufen

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=1521204767.20126.123.camel@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=Joakim.Tjernlund@infinera.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yuyufen@huawei.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