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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0386C433EF for ; Wed, 23 Mar 2022 18:04:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239995AbiCWSF5 (ORCPT ); Wed, 23 Mar 2022 14:05:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231695AbiCWSF4 (ORCPT ); Wed, 23 Mar 2022 14:05:56 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C360D3981B for ; Wed, 23 Mar 2022 11:04:25 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 10B841F41BC6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1648058664; bh=6st8P9PTIqIRBk5ipYU/AiKop2mvK2Z5ytdzu76/Ykg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=A4mkEhjaiR/Gqv0ga1PvnZ8DSqmLx4NFcuKLd0lY7Ym3yqrJnrVvcY2IresH8xBEF C3u514XRlgsQFbmnbOIbKgvacWPy7GNv/Uf1JlV/3AHTsflgCkLe8/4UWok2Jd796j j0s2+Gmi5lLC8qOVMfuuTBqAcgxirfuFNRsR3VlT/Py+kRDy8Bd8KRTKGfkM1VIGsL +bk5NJjBXnqwP4LPpz4GMbaKKmGwGkWymxg8d4wJftIR93UrwCCvcn0y40tg5APHlt cMLuVwgrtKo/tPEr5tCGK3IV6q/g8SlpvQFtMfw+oK9yZ6oyj8T47H3EwpwM0ErjA0 xp7KaCkNsJlIw== From: Gabriel Krisman Bertazi To: Amir Goldstein Cc: Hugh Dickins , Andrew Morton , Khazhismel Kumykov , Linux MM , kernel@collabora.com, linux-fsdevel Subject: Re: [PATCH 2/3] shmem: Introduce /sys/fs/tmpfs support Organization: Collabora References: <20220322222738.182974-1-krisman@collabora.com> <20220322222738.182974-3-krisman@collabora.com> Date: Wed, 23 Mar 2022 14:04:21 -0400 In-Reply-To: (Amir Goldstein's message of "Wed, 23 Mar 2022 01:58:07 +0200") Message-ID: <87sfr8r1ei.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Amir Goldstein writes: >> +static int shmem_register_sysfs(struct super_block *sb) >> +{ >> + int err; >> + struct shmem_sb_info *sbinfo = SHMEM_SB(sb); >> + __kernel_fsid_t fsid = uuid_to_fsid(sb->s_uuid.b); >> + >> + init_completion(&sbinfo->s_kobj_unregister); >> + err = kobject_init_and_add(&sbinfo->s_kobj, &tmpfs_sb_ktype, shmem_root, >> + "%x%x", fsid.val[0], fsid.val[1]); > > uuid (and fsid) try to be unique across tmpfs instances from different times. > You don't need that. > I think you'd rather use s_dev (minor number) which is unique among all tmpfs > instances at a given time and also much easier from user scripts to read from > (e.g. stat or /proc/self/mountinfo). > > That's btw the same number is used as an entry in /sys/fs/fuse/connections > (fusectl pseudo fs). Hi Amir, thanks for the review. Sounds good. I will follow up with a new version that uses MINOR(sb->s_dev). Thank you, -- Gabriel Krisman Bertazi