Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp3369383rwo; Fri, 4 Aug 2023 04:01:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHGy96EaIQ8Q8F+gB3hsHIcOTqh4DuefV7iaIm6kOiECsPpWIOCiHtWrSmtjXlaNwo44nzj X-Received: by 2002:a05:6402:138b:b0:522:582c:f427 with SMTP id b11-20020a056402138b00b00522582cf427mr1630713edv.14.1691146902838; Fri, 04 Aug 2023 04:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691146902; cv=none; d=google.com; s=arc-20160816; b=DEAREQ5qD1nIZ24JcaP7rWINcvYgck++kW7dYY0/tsqFfIXmG0ghFAgvDP6xk9mqGq nS/PlsP2XnJ21WM/b7Jfq+AAPFeLo7YPDCg9aWaPQTCYE5dsaHYtQyw34XREkGjNZrAH rtgObexMQWbpVMWhmHXsHGjY9RnRTkuN1Un8E9Ot4jd9VIApLorlCcXc9QqB0phuVy9U ZeiEiAgHF1Xj9OSYgdOnCp0jUhy8ePdPaUh64PCYaI66mp8nXuE79kFSlXjL1sciH69g xAwdhsOrh+Lgj81yvwLyJDYatAJO1IbSFn/TR4x/BTG3+MYcAUQsIz+Y6UXqpV8/njpx EzSw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z25-20020aa7cf99000000b00522ac23622dsi1454462edx.168.2023.08.04.04.01.18; Fri, 04 Aug 2023 04:01:42 -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 S229759AbjHDIuy (ORCPT + 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 ); 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 ; 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 ; 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 ; 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 To: xiubli@redhat.com Cc: brauner@kernel.org, stgraber@ubuntu.com, linux-fsdevel@vger.kernel.org, Jeff Layton , Ilya Dryomov , ceph-devel@vger.kernel.org, Alexander Mikhalitsyn , 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: X-Mailing-List: linux-kernel@vger.kernel.org From: Christian Brauner Enable mknod/symlink/mkdir iops to handle idmapped mounts. This is just a matter of passing down the mount's idmapping. Cc: Xiubo Li Cc: Jeff Layton Cc: Ilya Dryomov Cc: ceph-devel@vger.kernel.org Signed-off-by: Christian Brauner Signed-off-by: Alexander Mikhalitsyn --- 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; -- 2.34.1