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=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 74857C432C3 for ; Thu, 21 Nov 2019 11:40:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 392EA20898 for ; Thu, 21 Nov 2019 11:40:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cqi9aJN5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 392EA20898 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9AB236B030B; Thu, 21 Nov 2019 06:40:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 95B0E6B030C; Thu, 21 Nov 2019 06:40:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 84A706B030D; Thu, 21 Nov 2019 06:40:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0034.hostedemail.com [216.40.44.34]) by kanga.kvack.org (Postfix) with ESMTP id 71ADE6B030B for ; Thu, 21 Nov 2019 06:40:31 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 1E5A68249980 for ; Thu, 21 Nov 2019 11:40:31 +0000 (UTC) X-FDA: 76180091862.14.goat73_3ea942d092d17 X-HE-Tag: goat73_3ea942d092d17 X-Filterd-Recvd-Size: 4358 Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Thu, 21 Nov 2019 11:40:30 +0000 (UTC) Received: by mail-pj1-f68.google.com with SMTP id a16so1334404pjs.13 for ; Thu, 21 Nov 2019 03:40:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:in-reply-to:references:mime-version:content-id :date:message-id; bh=2YUMlMHb1jsKR64RBdqNyDWxhhWO2c6n/6/y+QUhsXs=; b=cqi9aJN5DS0t4kkWvzHf371mrRDQEFi6edvi7gt7M2M6PK1KmBjZGob0y8YhejBq6s JqRp3f+N/+TTqnYCR/eObOuBWKW5qKsLDnHQTfp02k6dLoUdBToTmwTXYdcq0S0Lph0z MgynN+SHIKGuuXuEWdwTt8suSRgn+iseddJN13Q9bDsqafTMTpTpwNWnQ6Dfo3ZOsYwz SGIEO0FLaLODJHvkVW8uMjv+mN2lvhJHA73Y1l+U8RjGnpf0OYl4OSODhBxeeHtDLK7e MFF6GRbh5wTC6G05/+pDfNPJZKGD0zrOzw7hsPzk7VHICglQmR9hZGv5xX6iG64qjX8G oHEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:in-reply-to:references :mime-version:content-id:date:message-id; bh=2YUMlMHb1jsKR64RBdqNyDWxhhWO2c6n/6/y+QUhsXs=; b=DBdLK1lCYmaWT4rUfZJLwNZkyD+d8Zx6xw9QnXuuVHdOYhw1PC3ZC0hj1gpgKEDgiy 5S8tIjq4oGtdYzSW6gLuBOm3W8twsJ5EZYJf/bQbb/MvqLvaVMtLZx1RQhzPf8nbiEh7 5ULlZEKVR6MKzDhwg9m9e/otaQSehz/E4OoHdi9qaeLR5C0Z3BpogYEG3vGKW0HUenfo +KkBY6VdmgYK6OVvQC4G0y8WgXOFlPd2FDF/o36T0SJgomeuCSlk3x/8z3lYITE+XjHA nKEs2jWBkNMEniMclFmlDoYShyQR2xuUhqY2cP3546WYu1MKBfyoCagOUVQQJpV61jgc bH7Q== X-Gm-Message-State: APjAAAV7oOE73oW9Sm/mftvjnw3gyXJX/Br9+A1MoFMyyPICXSU/WFCs nJpbl8Z86XU7nu9MK2GpZLo= X-Google-Smtp-Source: APXvYqwnj3iKGjyfCCyI5DdM5aWt57GIEXEiZbqYsrlc2X4heRPhPlIhOq2c0fech8/hXVhHT2WS2w== X-Received: by 2002:a17:902:76c8:: with SMTP id j8mr8348835plt.122.1574336429325; Thu, 21 Nov 2019 03:40:29 -0800 (PST) Received: from jromail.nowhere (h219-110-240-055.catv02.itscom.jp. [219.110.240.55]) by smtp.gmail.com with ESMTPSA id o129sm3441035pfg.75.2019.11.21.03.40.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Nov 2019 03:40:28 -0800 (PST) Received: from localhost ([127.0.0.1] helo=jrobl) by jrobl id 1iXkp0-0008NB-AW ; Thu, 21 Nov 2019 20:40:26 +0900 From: "J. R. Okajima" Subject: Re: [PATCH] tmpfs: use ida to get inode number To: Hugh Dickins Cc: "zhengbin (A)" , Matthew Wilcox , viro@zeniv.linux.org.uk, linux-mm@kvack.org, linux-kernel@vger.kernel.org, houtao1@huawei.com, yi.zhang@huawei.com In-Reply-To: References: <1574259798-144561-1-git-send-email-zhengbin13@huawei.com> <20191120154552.GS20752@bombadil.infradead.org> <1c64e7c2-6460-49cf-6db0-ec5f5f7e09c4@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32187.1574336426.1@jrobl> Date: Thu, 21 Nov 2019 20:40:26 +0900 Message-ID: <32188.1574336426@jrobl> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hugh Dickins: > Internally (in Google) we do rely on good tmpfs inode numbers more > than on those of other get_next_ino() filesystems, and carry a patch > to mm/shmem.c for it to use 64-bit inode numbers (and separate inode > number space for each superblock) - essentially, > > =09ino =3D sbinfo->next_ino++; > =09/* Avoid 0 in the low 32 bits: might appear deleted */ > =09if (unlikely((unsigned int)ino =3D=3D 0)) > =09=09ino =3D sbinfo->next_ino++; I agree with that "per superblock inum space", but I don't see your point. How can you manage it fully? I mean how can you decide whether the new inum is in use or not? For example, - you create a file which is assigned inum#10. - you or other people create and unlink over and over on the same tmpfs. - then sbinfo->next_ino will become zero, skipped, ok. - and then it will be 10. I don't think you want to share the same inum by two inodes. Moreover, SysV SHM uses tmpfs and shmget(2) overwrite inum internally. It will be another seed of a similar problem. J. R. Okajima