Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3406563ybl; Fri, 20 Dec 2019 08:47:30 -0800 (PST) X-Google-Smtp-Source: APXvYqzqeTKQyjOMuUSBStx2ZSaNyLvWMI5mKxLcarvnCt/x7O/TMcRrgI3DZMCrirAV08I1nuXT X-Received: by 2002:a05:6830:1042:: with SMTP id b2mr15929218otp.306.1576860450291; Fri, 20 Dec 2019 08:47:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576860450; cv=none; d=google.com; s=arc-20160816; b=1FSL34JairhhK9JkHUB8pO/wpCmFcZp3OX1tyumTeBx87lo3oo+1/7xynnYyvZw1bs wVuaefoZonPwkFbnp6Wrk/jtZXyKjL8i2NGjXO5p4ZwwUsObP+6p+EVrqZbFpJLjPcAK ZLLafEf9zTOKHrNtWCPCfxPlkHaQUC7pxAMSRs+EvxH6MyZwBQjCI+LyihEmBe1wHA/k pj16wxbLJqpxTNMgx6FXo3Zq0BJHyfz6Tva7jkVlVBqEqVVpdtc0XoV7JoU69UD5D2ar kKshcKvIMmcDNwhmrIyinmB/1DZPOoPDTdIXrBPGsb3A4Y/piOA4Aj9NWHYjoBy8f7ep TZBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=wBzPcwiacPh3r6JPPuX4OW3YmJm5b2HBjhLdhW1rrhw=; b=PyHAUIIkIGODD3chfYxoi25SJopNzQSwYX3dlOJb0OQtHN39HuatTh01NYVLrV5W0O aXNaEZ6cFAzOja0xrdpbvgheOkBAMGryQGk5pGGXWxBJsmMI6ncX/Rmq7aMvSE1gjmJQ Bp6BaDRMbSUfYw5k6EJAOCiS4qcomLAB0nnFiEqZ6OXU28fPWeGrPFB/Vb+nTpH6I/to EqXkUcR0bVsCdZrr+k2nt32LynPiyoHhDAlkKlBAt5pHknnGqwW8AeltiK0Ju/dAQAsj MLyIyZieADlF+MJxHLewQNkR+yTBQrwaQ61HC0hOYUIcJZgaBUwo0bOsez2R8u5o99fR in2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=gfWcV0ui; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p184si3617555oib.144.2019.12.20.08.47.18; Fri, 20 Dec 2019 08:47:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=gfWcV0ui; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727400AbfLTQqg (ORCPT + 99 others); Fri, 20 Dec 2019 11:46:36 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:54284 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727181AbfLTQqg (ORCPT ); Fri, 20 Dec 2019 11:46:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wBzPcwiacPh3r6JPPuX4OW3YmJm5b2HBjhLdhW1rrhw=; b=gfWcV0uibA4PFU/4rEbLjxkz5 MG8MgU55g11y3RIPF3OV3lH6YW6USCsaChSawFavqS03tMJMxbhzQNlUQ4LgBM9czPB2o1NXRqGzJ xsH8yvHWtPIOTxC6G6W+Jmdt6A9gU8VEl9ZXqU2Zk7tOSIFqT2E6eZPwtwbKfL99uKVOivoX5YxWC uWdNcE7sHIvr6yJ50gf/nC2wpbqxAQtaE2GWRlpCZVVwm5d1HL4yjArHFf0xmMzdldrHMNNn3Qjj1 OlTvms47JyJWNXCalo/YyzycxUlGS6VJ7DNLoSG6TsfGfZYvdXWJ/lThq4jLxjN3auQzvcE9ac5kf dbwLX4f3w==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1iiLQ8-0001ik-7Q; Fri, 20 Dec 2019 16:46:32 +0000 Date: Fri, 20 Dec 2019 08:46:32 -0800 From: Matthew Wilcox To: Amir Goldstein Cc: Chris Down , linux-fsdevel , Al Viro , Jeff Layton , Johannes Weiner , Tejun Heo , linux-kernel , kernel-team@fb.com, Hugh Dickins , Miklos Szeredi , "zhengbin (A)" Subject: Re: [PATCH] fs: inode: Reduce volatile inode wraparound risk when ino_t is 64 bit Message-ID: <20191220164632.GA26902@bombadil.infradead.org> References: <20191220024936.GA380394@chrisdown.name> <20191220121615.GB388018@chrisdown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 20, 2019 at 03:41:11PM +0200, Amir Goldstein wrote: > Suggestion: > 1. Extend the kmem_cache API to let the ctor() know if it is > initializing an object > for the first time (new page) or recycling an object. Uh, what? The ctor is _only_ called when new pages are allocated. Part of the contract with the slab user is that objects are returned to the slab in an initialised state. > 2. Let shmem_init_inode retain the value of i_ino of recycled shmem_inode_info > objects > 3. i_ino is initialized with get_next_ino() only in case it it zero > > Alternatively to 1., if simpler to implement and acceptable by slab developers: > 1.b. remove the assertion from cache_grow_begin()/new_slab_objects(): > WARN_ON_ONCE(s->ctor && (flags & __GFP_ZERO)); > and pass __GFP_ZERO in shmem_alloc_inode() WTF would that _mean_? I want this object to contain zeroes and whatever the constructor sets it to. WHich one wins?