Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1197964

Re: v4.2-rc dcache regression, probably 75a6f82a0d10

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Dominique Martinet <asmadeus@codewreck.org>
Newsgroups linux.kernel
Subject Re: v4.2-rc dcache regression, probably 75a6f82a0d10
Date Sat, 01 Aug 2015 12:20:02 +0200
Message-ID <pSC3v-1Jd-9@gated-at.bofh.it> (permalink)
References <pSmBs-4qd-11@gated-at.bofh.it> <pSnxw-5Mb-1@gated-at.bofh.it> <pSotC-78K-71@gated-at.bofh.it> <pSpzl-hg-25@gated-at.bofh.it> <pSrrs-32C-7@gated-at.bofh.it> <pSzp0-6i2-1@gated-at.bofh.it>
X-Original-To Al Viro <viro@ZenIV.linux.org.uk>
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 53
Organization linux.* mail to news gateway
X-Original-Cc Linus Torvalds <torvalds@linux-foundation.org>, Hugh Dickins <hughd@google.com>, "J. Bruce Fields" <bfields@fieldses.org>, Dominique Martinet <dominique.martinet@cea.fr>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, linux-fsdevel <linux-fsdevel@vger.kernel.org>, David Howells <dhowells@redhat.com>
X-Original-Date Sat, 1 Aug 2015 12:19:13 +0200
X-Original-Message-ID <20150801101913.GA24028@nautica>
X-Original-References <alpine.LSU.2.11.1507311022320.10162@eggly.anvils> <CA+55aFxGp3Hn-CeFE1NTYDr7vt3xjqe2mV1BbZ2tYHpCxenuAA@mail.gmail.com> <alpine.LSU.2.11.1507311207160.11122@eggly.anvils> <20150731205036.GA3752@nautica> <CA+55aFz9jj_wAjXNoFbKFbV3M1Ki2KhHuoMwQGPi0wiQjMXdsw@mail.gmail.com> <20150801072603.GV17109@ZenIV.linux.org.uk>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1197964

Show key headers only | View raw


Al Viro wrote on Sat, Aug 01, 2015:
> And that has turned the check done to an inode that *was* ours at some
> point (i.e. fetching it had been followed by checking that ->d_seq had
> been still valid) into something completely unprotected.  Suppose we
> are in lazy mode and somebody had evicted nd->path.dentry after we'd looked
> it up and before that check.  Sure, its ->d_seq had been bumped by that,
> and we would've failed anyway.  With ECHILD.  Which, unlike ENOTDIR, is
> "repeat in non-lazy mode".

That sounds like a good find, I was looking at how to claim/protect the
entry somehow as well but I just have no idea...

> Folks, could you check if this fixes the problems you are seeing?
> 
> diff --git a/fs/namei.c b/fs/namei.c
> index ae4e4c1..b16c3a7 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -1954,7 +1954,11 @@ OK:
>  				continue;
>  			}
>  		}
> -		if (unlikely(!d_can_lookup(nd->path.dentry)))
> +		if (unlikely(!d_can_lookup(nd->path.dentry))) {
> +			if (nd->flags & LOOKUP_RCU) {
> +				if (unlazy_walk(nd, NULL, 0))
> +					return -ECHILD;
> +			}
>  			return -ENOTDIR;
>  	}
>  }

Unfortunately, still happens for me.

I had to adapt a bit because using an old kernel (4bf46a272), will try
again with a recent master to doublecheck, but I had a break on
the "if (nd->flags & LOOKUP_RCU)" check:
 - sometimes fails without ever hitting the check. I think this fixes
the "ENOTDIR" I had described, but there's at least another way to
fail?
 - When we do hit it, we're into LOOKUP_RCU at this point alright,
unlazy_walk fails and we try again without RCU -- can confirm the
recovery process goes OK (well, that it went OK at least once)


Thanks,
-- 
Dominique
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: v4.2-rc dcache regression, probably 75a6f82a0d10 Dominique Martinet <asmadeus@codewreck.org> - 2015-08-01 12:20 +0200
  Re: v4.2-rc dcache regression, probably 75a6f82a0d10 Dominique Martinet <asmadeus@codewreck.org> - 2015-08-01 13:00 +0200

csiph-web