Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5933929rwd; Wed, 24 May 2023 08:37:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Df8gSeS0cQH2xUXrr/Ebt8LYHIsLrK6KUBDwY2q+HmpYMLKYCCkc/er/LYhXQn+pndbBD X-Received: by 2002:a17:90b:30d1:b0:250:1127:841c with SMTP id hi17-20020a17090b30d100b002501127841cmr15814856pjb.18.1684942649551; Wed, 24 May 2023 08:37:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684942649; cv=none; d=google.com; s=arc-20160816; b=wS7uXUGyaUmdllxNFbrsguBM0uyYJfv/ilbOD9BlbzjtGPYmHltBd5mMBP749tX89z x2KW4qoRj2qoTYgiql/Ru9O85L8B1wwtF6bw1h7mSFugYE3fGSic7nybmcSO8n5M9YzC af6c4zdiOdmYpvn+jjT2eBlQ3THy9ET//gXN0mQLS9XGwdW8Y/QT+tv4BmbvdQacfThi vl9eZOg1qF1WOcb2ye3Ihz5GQYzIPYKWHxF9LX8lojkIZUMkBEaEKW2xUJPMfs+nar5S hMSPLiCJL9XvjZCQrz9+Blx5eo+h1Fin5E7PZo5+7tYFP4Le7KAheXQhSTGGsQDwLGjr HKGA== 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=EWhp3bFE5YGNYZTeqnLuyw/BwJKRfP8fBMMP2Kg8LVA=; b=wmUGr7rwF5NW4P/7wjo2AHqrlYly0n+76EAbVBJn6Eaj1EEV2+jOzRfftfCatxACIn GolsON2wor6oesSaQqP2eAAWTVzcR/9A9PsUIjCE8XRfRGN4tpfFje4opQxZBMdwlH9O luXvxvUMYx/fLXAa3U3MP0jmyEjqfz3+Zur6LOHlqDTioTWCnhTF8TQckg5bit3xXWEp BhId4XU5GCDlqiYnNYqTrrR2hKPGbnqNzBtPWD8ksyipdmqZHMcd48tefzggRvqEzcy4 Ja7/ZUQk4ZMYvy+rwA39ydQGMZKXhkyrZ/4H4yg3iv/vADR+ERi4GCOgvaivrV/LOwm+ DLFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=hEvuMSZ2; 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 v14-20020a17090a6b0e00b002469c3f344asi1588305pjj.93.2023.05.24.08.37.13; Wed, 24 May 2023 08:37:29 -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=hEvuMSZ2; 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 S236117AbjEXPej (ORCPT + 99 others); Wed, 24 May 2023 11:34:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235342AbjEXPef (ORCPT ); Wed, 24 May 2023 11:34:35 -0400 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20428119 for ; Wed, 24 May 2023 08:34:10 -0700 (PDT) Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (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-0.canonical.com (Postfix) with ESMTPS id 558573F179 for ; Wed, 24 May 2023 15:33:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1684942429; bh=EWhp3bFE5YGNYZTeqnLuyw/BwJKRfP8fBMMP2Kg8LVA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=hEvuMSZ2BeoPvQPD4BTr1eV8g6z5we1ykH5gFhohLxheGvp+kArJWQulAp9eHXJV9 xFh9rtaD8PI1fEJnLWBjpsylLgVGZIkd5/drPM7U6/jH++tnpmwfPdxUwLdezxPCYo sD56Sn3vKNdgQHzN7bzeNinlXhtGqrQK+qnfQYkTwyRiiJKENXhwDyOGaoqLiyhg7y yuJsRUlKVHBu7kLvkRSZ56+v9yWBcgPNjgIwu6yHhrWKbztzFRnbFaXZ5aaKNvoyHg OH7fuN2bpUeXWPsQLsg9+EVEFvR57hr1fmspNjj1bo9937jVrOgbc6WEkk+LpepzrJ Bma0EvkEcjmuQ== Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-9715654ab36so109486066b.0 for ; Wed, 24 May 2023 08:33:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684942429; x=1687534429; 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=EWhp3bFE5YGNYZTeqnLuyw/BwJKRfP8fBMMP2Kg8LVA=; b=Afha7gtXtnwYvtxBtdso61iFjhVFAlL/uNH/5TUaTs7IBrhjToxYyqmErtjYsQyIPi gtIr6GALlRHUtQpnj5kBizUQTww/kLUBA6sZxHLG0VONyVz0MVlUlkSDgX92gQrEHtIT VUlQApydkmEG5oPEiLD4SAleqUMiOUI5dO8qW5L7cUgWro/MQutBzEJ3AiUMrSeDcumu cvRPqlFFI91h1jPbjGpFwQ/+JWN+ZKq7USUcd57kdmGCtEYCGcXjPjMa+5Od3S9/bYWm aZXgcAJ2H13j7aS/jE9chRZXPnhxadqpcGsLIUXZK0LRIspbVHDmKURnThbD9AqrtbQg Uqew== X-Gm-Message-State: AC+VfDzVlF3lqUScF6VajbwYePUgVEHRzhDLGy2FBRRrS+VQrJ2kxsp5 f4K4oE+gXPdnhCB3VE6d1F6YiOdobZuL15frfuScKyo2wYPb2/LG2H+RW4Y/ZHmwXksWWwOQI0e /hU2P+7wFYYqN0AFKoHE8zl7z3VBXxsnXxN762qgoYg== X-Received: by 2002:a17:906:ee81:b0:96f:1629:3e9a with SMTP id wt1-20020a170906ee8100b0096f16293e9amr7864682ejb.34.1684942428986; Wed, 24 May 2023 08:33:48 -0700 (PDT) X-Received: by 2002:a17:906:ee81:b0:96f:1629:3e9a with SMTP id wt1-20020a170906ee8100b0096f16293e9amr7864653ejb.34.1684942428590; Wed, 24 May 2023 08:33:48 -0700 (PDT) Received: from amikhalitsyn.local (dslb-088-074-206-207.088.074.pools.vodafone-ip.de. [88.74.206.207]) by smtp.gmail.com with ESMTPSA id p26-20020a17090664da00b0096f7105b3a6sm5986979ejn.189.2023.05.24.08.33.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 08:33:48 -0700 (PDT) From: Alexander Mikhalitsyn To: xiubli@redhat.com Cc: brauner@kernel.org, stgraber@ubuntu.com, linux-fsdevel@vger.kernel.org, Alexander Mikhalitsyn , Ilya Dryomov , Jeff Layton , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 00/13] ceph: support idmapped mounts Date: Wed, 24 May 2023 17:33:02 +0200 Message-Id: <20230524153316.476973-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, RCVD_IN_MSPIKE_H2,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 Dear friends, This patchset was originally developed by Christian Brauner but I'll continue to push it forward. Christian allowed me to do that :) This feature is already actively used/tested with LXD/LXC project. v2 is just a rebased version of the original series with some small field naming change. Git tree (based on https://github.com/ceph/ceph-client.git master): https://github.com/mihalicyn/linux/tree/fs.idmapped.ceph.v2 Original description from Christian: ======================================================================== This patch series enables cephfs to support idmapped mounts, i.e. the ability to alter ownership information on a per-mount basis. Container managers such as LXD support sharaing data via cephfs between the host and unprivileged containers and between unprivileged containers. They may all use different idmappings. Idmapped mounts can be used to create mounts with the idmapping used for the container (or a different one specific to the use-case). There are in fact more use-cases such as remapping ownership for mountpoints on the host itself to grant or restrict access to different users or to make it possible to enforce that programs running as root will write with a non-zero {g,u}id to disk. The patch series is simple overall and few changes are needed to cephfs. There is one cephfs specific issue that I would like to discuss and solve which I explain in detail in: [PATCH 02/12] ceph: handle idmapped mounts in create_request_message() It has to do with how to handle mds serves which have id-based access restrictions configured. I would ask you to please take a look at the explanation in the aforementioned patch. The patch series passes the vfs and idmapped mount testsuite as part of xfstests. To run it you will need a config like: [ceph] export FSTYP=ceph export TEST_DIR=/mnt/test export TEST_DEV=10.103.182.10:6789:/ export TEST_FS_MOUNT_OPTS="-o name=admin,secret=$password and then simply call sudo ./check -g idmapped ======================================================================== Alexander Mikhalitsyn (1): fs: export mnt_idmap_get/mnt_idmap_put Christian Brauner (12): ceph: stash idmapping in mdsc request ceph: handle idmapped mounts in create_request_message() ceph: allow idmapped mknod inode op ceph: allow idmapped symlink inode op ceph: allow idmapped mkdir inode op ceph: allow idmapped rename inode op ceph: allow idmapped getattr inode op ceph: allow idmapped permission inode op ceph: allow idmapped setattr inode op ceph/acl: allow idmapped set_acl inode op ceph/file: allow idmapped atomic_open inode op ceph: allow idmapped mounts fs/ceph/acl.c | 2 +- fs/ceph/dir.c | 4 ++++ fs/ceph/file.c | 10 ++++++++-- fs/ceph/inode.c | 15 +++++++++++---- fs/ceph/mds_client.c | 29 +++++++++++++++++++++++++---- fs/ceph/mds_client.h | 1 + fs/ceph/super.c | 2 +- fs/mnt_idmapping.c | 2 ++ include/linux/mnt_idmapping.h | 3 +++ 9 files changed, 56 insertions(+), 12 deletions(-) -- 2.34.1