Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp15181749rwd; Sun, 25 Jun 2023 11:56:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ63aRFUqIQx/W0mjah9W12iCBDqa2WwFtfx/mAJ5XkwVdckV9PLj8nYjmcKXFkKHIqnKSfr X-Received: by 2002:a17:902:f688:b0:1b2:4042:d227 with SMTP id l8-20020a170902f68800b001b24042d227mr6266632plg.12.1687719386038; Sun, 25 Jun 2023 11:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687719386; cv=none; d=google.com; s=arc-20160816; b=Fpic2ODGqFBN6Y9z/vgMegRxNGVUW436tmQw7Ao3bxNT3o+5/ENItO1QI+u2brkmH1 Jbc8dg8KGh7v7i+zuNA5Wk+R89S1EbWMkEvIXb9yXRxIbSyfyMtnh736/+POr4Xe9RaZ QYz0xctQ+wEk3lzC8ohQziV0V/hhyeFkkFEzxsd9Wubi3lz0R1kX/ldlKHHO15GCBpyn 3bo/zjP/mLOG87YbvDi2TU9+5EwJ4I9MuRqFU8MZEc9V3hz1Ov7LvvZ1uVAfH6ydJJHY eH/tRzGxIcYokTQB7cWfA2YoLUMgbJzm/cNR+kdJ4XfNmwBewYJx+QoAFNMOrR0nwOPA GhbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=wxjGe/lCblUrN68a4XQN1nsTtxNGrWMej+sIZU4igV4=; fh=HQ8ZROa5ktUEZeqdar+pe8oSCSHzxkpIID6es6ydt58=; b=YHOb2S2wqYOP0a894XArZhv+6A/VgpwwIyuJVvebJNv7pbGxxygd5P9d/IrNj0P0+g o8L2EBesJL0N8VIYjYxEqLlUiIjGDr18/WxURrCEwI6cbd6ZffO9QqgSKOT/m7VLKs0K 8p78SPuUt61pdd54GmK1hqzDA2fH4zNop9Ljseckv6zyhYT0TrdO3rwZHWWTz3QPiQQI Hk1aqRMaMAcjOb3gSVEfeeGc3IXnp+CWEh1GhJpc4SuMhB8h9bIsJWBlkg1JeogiHamb k1CIiJKQcgbURW1YsguRImY7n0uinjf9Y1K04aK9wQ/V3LIRn3Wbk8aRWQR/cRFz8Rww 4pmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=FUJVrFFl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c21-20020a170902849500b001b3d822f131si3310297plo.239.2023.06.25.11.56.14; Sun, 25 Jun 2023 11:56:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=FUJVrFFl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229636AbjFYSVZ (ORCPT + 99 others); Sun, 25 Jun 2023 14:21:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbjFYSVW (ORCPT ); Sun, 25 Jun 2023 14:21:22 -0400 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB1D91BD for ; Sun, 25 Jun 2023 11:21:21 -0700 (PDT) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 9B7D43F1A0 for ; Sun, 25 Jun 2023 18:21:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1687717277; bh=wxjGe/lCblUrN68a4XQN1nsTtxNGrWMej+sIZU4igV4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=FUJVrFFluUJSBD3IgKzYODyyNRiYQBFySpg/i5QzgHxDq6WQdoawXWQWOmDk7xoWy OiPQzKSO4p5clbMrypuOfc4lCycUzMS6azxOnJW4RzPmhf2HVHt1sjm/ttzvK1wexy VysW8XOv4k8Wj6UV9w+vBtzGRFzxgko5XUC+QhAShyjb+xyEXt+V0yR7oTTPvr77Df 6+Syp94wNP2rAui7cZxBGVGWraRILY9xrrKtBE7pUtyJ0mJG2fJNwQsW9dSpx83hHk hDDhcX5JWR2T9sHFiXJJnRWvNghVZn8GEkKmWX9hINl2LgEknWVADlzE3rERqZScV5 ZjPhVEiOBhC5g== Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-3129750e403so1631873f8f.3 for ; Sun, 25 Jun 2023 11:21:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687717277; x=1690309277; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wxjGe/lCblUrN68a4XQN1nsTtxNGrWMej+sIZU4igV4=; b=GqNJ4pRgg4kBcwOcw+4TUV79kttBagsnxSDfQBsJhGiIusaOHGu5M4oybJD6dT02uh WglOQE9Tvpwq8jqQDe98dP2FMBE6gxpR2HRiLFsEv+Z2gyVbNJglDDPfOiVFlJ7FAZF1 EXr1dlTI+15VFi6kcCPL8pqXr+o3cOKxrdt+RA/JzcdSoACkfqqe/gUr/q0wiHYomH4p EhrwQuI6Htm2n5X7iPh3x+4ryQqc1644pqJ3WAxdW8Q4TdTsWqWNPbWbfd72v68Sto/E ZFGgSxbLevlxHGqMSBW0B8BaNeE3m99FLTAPxDygAPHfiXV7HUU/cBUf1Pm6zxJYefhs iazQ== X-Gm-Message-State: AC+VfDw2HvqS9qC6eEE5Ta15yv/DtnlvvZZvYJJ8z90YOPPGL4pP6tQX aZdS/dwaTrxKZH4FunkeRWGhf9h5TVZ2IroMdWcie7aJogSqFmphMqUqOf8ZgA83l6S4fSaVGXW wSTGYH+y8QrY+UhXHHnG9EGK49FGbAaQd5qwKdW5WGQ== X-Received: by 2002:a05:6000:128b:b0:313:e355:3882 with SMTP id f11-20020a056000128b00b00313e3553882mr3748695wrx.44.1687717277250; Sun, 25 Jun 2023 11:21:17 -0700 (PDT) X-Received: by 2002:a05:6000:128b:b0:313:e355:3882 with SMTP id f11-20020a056000128b00b00313e3553882mr3748675wrx.44.1687717276747; Sun, 25 Jun 2023 11:21:16 -0700 (PDT) Received: from amikhalitsyn.local (dslb-002-205-064-187.002.205.pools.vodafone-ip.de. [2.205.64.187]) by smtp.gmail.com with ESMTPSA id u14-20020adfdb8e000000b003112ab916cdsm5190381wri.73.2023.06.25.11.21.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jun 2023 11:21:16 -0700 (PDT) From: Alexander Mikhalitsyn To: brauner@kernel.org Cc: linux-fsdevel@vger.kernel.org, Alexander Mikhalitsyn , Jonathan Corbet , linux-doc@vger.kernel.org, Seth Forshee , linux-kernel@vger.kernel.org Subject: [PATCH v2] docs: filesystems: idmappings: clarify from where idmappings are taken Date: Sun, 25 Jun 2023 20:20:47 +0200 Message-Id: <20230625182047.26854-1-aleksandr.mikhalitsyn@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let's clarify from where we take idmapping of each type: - caller - filesystem - mount Cc: Jonathan Corbet Cc: Christian Brauner Cc: linux-fsdevel@vger.kernel.org Cc: linux-doc@vger.kernel.org Signed-off-by: Alexander Mikhalitsyn --- v2: - fixed https://lore.kernel.org/oe-kbuild-all/202306252253.qxHG1txo-lkp@intel.com/ --- Documentation/filesystems/idmappings.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/filesystems/idmappings.rst b/Documentation/filesystems/idmappings.rst index ad6d21640576..f3d168c9f0b9 100644 --- a/Documentation/filesystems/idmappings.rst +++ b/Documentation/filesystems/idmappings.rst @@ -373,6 +373,13 @@ kernel maps the caller's userspace id down into a kernel id according to the caller's idmapping and then maps that kernel id up according to the filesystem's idmapping. +From the implementation point it's worth mentioning how idmappings are represented. +All idmappings are taken from the corresponding user namespace. + + - caller's idmapping (usually taken from ``current_user_ns()``) + - filesystem's idmapping (``sb->s_user_ns``) + - mount's idmapping (``mnt_idmap(vfsmnt)``) + Let's see some examples with caller/filesystem idmapping but without mount idmappings. This will exhibit some problems we can hit. After that we will revisit/reconsider these examples, this time using mount idmappings, to see how -- 2.34.1