From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 284F8C004C9 for ; Tue, 7 May 2019 19:16:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0806520825 for ; Tue, 7 May 2019 19:16:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726091AbfEGTQS (ORCPT ); Tue, 7 May 2019 15:16:18 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:50786 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbfEGTQS (ORCPT ); Tue, 7 May 2019 15:16:18 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1hO5ZV-0005QU-LQ; Tue, 07 May 2019 19:16:13 +0000 Date: Tue, 7 May 2019 20:16:13 +0100 From: Al Viro To: Linus Torvalds Cc: yangerkun , linux-fsdevel , yi.zhang@huawei.com, houtao1@huawei.com, miaoxie@huawei.com Subject: Re: system panic while dentry reference count overflow Message-ID: <20190507191613.GI23075@ZenIV.linux.org.uk> References: <20190507004046.GE23075@ZenIV.linux.org.uk> <20190507041552.GH23075@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Tue, May 07, 2019 at 08:26:06AM -0700, Linus Torvalds wrote: > On Mon, May 6, 2019 at 9:15 PM Al Viro wrote: > > > > Umm... Where would you put the cutoff for try_dget()? 1G? Because > > 2G- is risky - have it reached, then > > get the rest of the way to 2G by normal dget() and you've got trouble. > > I'd make the limit be 2G exactly like the page count. Negative counts > are fine - they work exactly like large integers. It's only 0 that is > special. Negative ->d_lockref.count are used for "lockref is dead"... > - add the "limit negative dentries" patches that were already written > for other reasons by Waiman Long. Irrelevant here, IMO - negative or not (and evictable or pinned, for that matter) it's easier solved by having d_alloc() fail on parent's ->d_count overflow. And I'm pretty sure we can hit that crap without creating any negative dentries.