Message ID | 20230804084858.126104-6-aleksandr.mikhalitsyn@canonical.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:44a:b0:3f2:4152:657d with SMTP id ez10csp130786vqb; Fri, 4 Aug 2023 02:15:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFCUeKmRzTaLYxxOwKJ2RWc00DGrbBcTb42cINXErwGgCUo5R0y3fyDrM5dDPYSrLD+lRp8 X-Received: by 2002:a05:6402:1d51:b0:522:28b9:e84c with SMTP id dz17-20020a0564021d5100b0052228b9e84cmr1302154edb.21.1691140539879; Fri, 04 Aug 2023 02:15:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691140539; cv=none; d=google.com; s=arc-20160816; b=fIa61Falmg8+VsMVssxt0neAYXbfvGqGE0JZevpHEswrUYV2LnaXTmlVsQw54FhZBv iI9j1x01wmJoFEj0bGkArfcit5oNI7+MFdVxPVTJ/ZG1MysZPJMCS5X0aSzTAPWKRpMW F2czXRXbWQNT/Z8tXISuPFWcxea327/WDgZRfSHxHkI/xqfiunyPXChR8LMmyE5/nZ41 whyQwtTzzxjz3GdlJM3h4PAz5n0lyGr6+0ABIBVzSU3ZWY33khUssrgpxO7msklwsCes SYnUawlfp1vhpHhEJS9YDPNNS1y6B0tbS57ZEyST8AIa73+Sw6gtbt5xiGxr4WRxQPhd DgMw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mZe9Srkw8mk9+UpxCgBj79JVdzJ8PXD8OnJawp13C+4=; fh=Z2mkFIQPI1atT1PXylFFs5aXkUtGzwkgwqJaEftWDsI=; b=P2UeWuX58gMihHjWnuC5IVKHhhH9uCHrPY69CZFo6bw7QNRW0pHo3RX6Uwe+q9rTE1 pZ5B50vTk+tSHjeKeWGWQ7AVRBvYY6jRcsvQKgnBY4QU5ippUVjdZFzxiATHuz1t7yJ8 cpN+Ft4Zcgcjs8ayKEqkV/ILCglcLGZKmRD4E+ALNhMkb9aAvX703QCcYBOQxFrwBoCH K1IZi7C7fy1xUPds8i+q7KNu8xi8JQG4UofGjxeYET2PK1xTgU0lHzGEBvseTe2Mpa1a SgqLdAPqx8Il4pWQ9ggLkehj+3yebZ3xA3G86QkSDgddQ5yZhAzPDYI81WB7QwwRiCPh GAGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=SwHT3qEF; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g18-20020a056402181200b005222709bc35si1300382edy.197.2023.08.04.02.15.16; Fri, 04 Aug 2023 02:15:39 -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=SwHT3qEF; 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 S229888AbjHDIuy (ORCPT <rfc822;sukrut.bellary@gmail.com> + 99 others); Fri, 4 Aug 2023 04:50:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229761AbjHDItm (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 4 Aug 2023 04:49:42 -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 8CE994C3B for <linux-kernel@vger.kernel.org>; Fri, 4 Aug 2023 01:49:39 -0700 (PDT) Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (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 C7CC03F205 for <linux-kernel@vger.kernel.org>; Fri, 4 Aug 2023 08:49:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1691138977; bh=mZe9Srkw8mk9+UpxCgBj79JVdzJ8PXD8OnJawp13C+4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SwHT3qEFYsgQTrcZKivEqLIyocWHk2VxMCYuienXEU18fS4cv6hal/HXWkDzmt0oh Pm45Cs2lIcWL99S8Tyz8F7Njb0RorTEg0+vD9iyULOra7alfT0gn4t1492ra1bNlFI qQYdK+GbdZ5dt57SU/y9BrInO+GFuTXW72Fu3dnWs9NEWPBMqtQhPLS2hgbm+68FDI zFNd3fyxY2XOCZXjIASAmt1Qk8GUobh62c7RsYQoAtqTHrIx6HDWBAc4dztBIbhWvA uMdyUKDH/Mwij9CJqlHBJmTMWD86kmcO71VpmavIDTffnYcRR+Ixu5nBH2n43SyQSV Q2mHx0+ud503w== Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-99bfe3dd009so356603366b.0 for <linux-kernel@vger.kernel.org>; Fri, 04 Aug 2023 01:49:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691138977; x=1691743777; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mZe9Srkw8mk9+UpxCgBj79JVdzJ8PXD8OnJawp13C+4=; b=IUlLz1ZNScspN6dIy3JOxGrSgHz6S3mCTcXRrgqrMiXUjtVlK7hl8gWy/ZlVkfQUBz 1IyfFa2Fnj3UH4foeBHtS6KF8U+I1eVILwMk+KqPtouQOKFuc8UhgZut1N/QFP8ncNwd BqixfCGuDjorMjaiOklGs4vv8ofP+t+EaPaA5fLKLt0on/uo6538HsFZ73AM36JhQJ9f GsbJxEroD2VdJKJWCDUrtM6sZ7u6bV6HTQbWG6GiKsCq4H/EtOoWtrXiMO6TJ2yTY1Co 2/JV8WU/5ecydaDBYlS4bCKPPxhowCg537WDOmHMk9Y21yhL9gCYj68eF4bhsEb5ab/b hkMw== X-Gm-Message-State: AOJu0YzeY7aa9wRCAbS5EtYZHYehJuY3YkGi9O7SbnaIJkWNH2ayneZJ 0X+3oBwzXSMDq5PFE6Q5WLqNMz6Ds344bLsZOm+QxrPmG6FpqaNbQAl54IkpyA4O0FApkDrVmJh ZvCEHSBCEYhQF6XcXExuZZ/wYNrAU5j9+QqWg+4bDBA== X-Received: by 2002:a17:906:30c4:b0:99b:50ea:2f96 with SMTP id b4-20020a17090630c400b0099b50ea2f96mr1353116ejb.12.1691138977189; Fri, 04 Aug 2023 01:49:37 -0700 (PDT) X-Received: by 2002:a17:906:30c4:b0:99b:50ea:2f96 with SMTP id b4-20020a17090630c400b0099b50ea2f96mr1353099ejb.12.1691138976964; Fri, 04 Aug 2023 01:49:36 -0700 (PDT) Received: from amikhalitsyn.local (dslb-088-066-182-192.088.066.pools.vodafone-ip.de. [88.66.182.192]) by smtp.gmail.com with ESMTPSA id k25-20020a17090646d900b00992e94bcfabsm979279ejs.167.2023.08.04.01.49.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Aug 2023 01:49:36 -0700 (PDT) From: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com> To: xiubli@redhat.com Cc: brauner@kernel.org, stgraber@ubuntu.com, linux-fsdevel@vger.kernel.org, Jeff Layton <jlayton@kernel.org>, Ilya Dryomov <idryomov@gmail.com>, ceph-devel@vger.kernel.org, Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>, linux-kernel@vger.kernel.org Subject: [PATCH v9 05/12] ceph: pass an idmapping to mknod/symlink/mkdir Date: Fri, 4 Aug 2023 10:48:51 +0200 Message-Id: <20230804084858.126104-6-aleksandr.mikhalitsyn@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230804084858.126104-1-aleksandr.mikhalitsyn@canonical.com> References: <20230804084858.126104-1-aleksandr.mikhalitsyn@canonical.com> 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,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773289382257243604 X-GMAIL-MSGID: 1773289382257243604 |
Series |
ceph: support idmapped mounts
|
|
Commit Message
Aleksandr Mikhalitsyn
Aug. 4, 2023, 8:48 a.m. UTC
From: Christian Brauner <brauner@kernel.org> Enable mknod/symlink/mkdir iops to handle idmapped mounts. This is just a matter of passing down the mount's idmapping. Cc: Xiubo Li <xiubli@redhat.com> Cc: Jeff Layton <jlayton@kernel.org> Cc: Ilya Dryomov <idryomov@gmail.com> Cc: ceph-devel@vger.kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com> --- v4: - call mnt_idmap_get v7: - don't pass idmapping for ceph_rename (no need) --- fs/ceph/dir.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index b752ed3ccdf0..397656ae7787 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -952,6 +952,7 @@ static int ceph_mknod(struct mnt_idmap *idmap, struct inode *dir, req->r_parent = dir; ihold(dir); set_bit(CEPH_MDS_R_PARENT_LOCKED, &req->r_req_flags); + req->r_mnt_idmap = mnt_idmap_get(idmap); req->r_args.mknod.mode = cpu_to_le32(mode); req->r_args.mknod.rdev = cpu_to_le32(rdev); req->r_dentry_drop = CEPH_CAP_FILE_SHARED | CEPH_CAP_AUTH_EXCL | @@ -1067,6 +1068,7 @@ static int ceph_symlink(struct mnt_idmap *idmap, struct inode *dir, } set_bit(CEPH_MDS_R_PARENT_LOCKED, &req->r_req_flags); + req->r_mnt_idmap = mnt_idmap_get(idmap); req->r_dentry = dget(dentry); req->r_num_caps = 2; req->r_dentry_drop = CEPH_CAP_FILE_SHARED | CEPH_CAP_AUTH_EXCL | @@ -1146,6 +1148,7 @@ static int ceph_mkdir(struct mnt_idmap *idmap, struct inode *dir, req->r_parent = dir; ihold(dir); set_bit(CEPH_MDS_R_PARENT_LOCKED, &req->r_req_flags); + req->r_mnt_idmap = mnt_idmap_get(idmap); req->r_args.mkdir.mode = cpu_to_le32(mode); req->r_dentry_drop = CEPH_CAP_FILE_SHARED | CEPH_CAP_AUTH_EXCL | CEPH_CAP_XATTR_EXCL;