From nobody Tue Sep 9 22:29:18 2025 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 1AB9EC001DB for ; Mon, 7 Aug 2023 13:30:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233848AbjHGNaL (ORCPT ); Mon, 7 Aug 2023 09:30:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234176AbjHGN3V (ORCPT ); Mon, 7 Aug 2023 09:29:21 -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 1957C2136 for ; Mon, 7 Aug 2023 06:29:02 -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 494564427E for ; Mon, 7 Aug 2023 13:28:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1691414907; bh=EnTEEZ7+oa3hM+NWnyW7RuhD3+Wjh3nw4+rmmgyNCZM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eRdQY7FVP9XiNEXM01byHvRqj8W92WV1cuDZE2iFGmn8PD1MFUsFQw/8qmBONbTfc bilZilubs3SQeUoM/nSE2xjouBSctNtYqLLSgwUhOyPQ9a291Sq5u4YN2szmyDqf4s ONZoZlKR+Xxzczmqi1aLKRomZ2bppGx3X1dhPhXm7tgmQuUUfZ+sq3RgW7oD7bkqpr m2Rkv6wwJ9iJKeEZuK0ulSq39yxeM0FzBS5pQhubWDhNg9DBLedbLqzZL+SOCL3UI1 jjNEEsg/6CCaWeBwTLXZ0/uveqPYpFjQ5wCCQiTMO3AQq5IQ8W8XWF9qzjobBGQYYy gVlarWiPnKclw== Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-978a991c3f5so363847666b.0 for ; Mon, 07 Aug 2023 06:28:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691414905; x=1692019705; 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=EnTEEZ7+oa3hM+NWnyW7RuhD3+Wjh3nw4+rmmgyNCZM=; b=WGEIIOcefhAR6LOgh4id9SUl0Xg35QiOBI8MtMLmAFbe0WhKUpMi5YWxeMuDw9EIhU tsaZGF2EXBhUOfzpXZ5Or5K89DEEJhWgy8aLqSJzNEfGZwcSYnF2SuEVukS4r6Ir0Qm2 NyHhwhRgAW5hKsy2Xc0ZWSRxWY3LgXrxY5FCsogVz67tq7/l65scBHyTsheX97hJTOSy 00hfeqP86zlz5AwVQNNmc1tbbecJn32jwaekZjRuZ3WgfJMlcCo6q5j2w+vPCDcqNoj/ DT/uL8oXPYVuyuvqIYI0d97MJyUWolKYQXd/2x/sjBtEfU132ffuXpHcf4QlDYGGpijC C9tg== X-Gm-Message-State: AOJu0YwU8dZIUPxwt1Ih2UZQiURW1nTWndfVD9hgc5AU0CbIBKPzaygk 1WVuVBYdyY5Pr3Jhp9cWPRcOUPqye5OSg4okizHN8b1LFgGoaI9Qg8e5aY5cIozBjG0JB+jOo8e YP+wUEK2+yhfPIEapYOSROyreCgJtTikikf/ISpmTtQ== X-Received: by 2002:a17:906:d6:b0:99b:ed8f:551d with SMTP id 22-20020a17090600d600b0099bed8f551dmr8792964eji.55.1691414905240; Mon, 07 Aug 2023 06:28:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPYr2Sn/4wtYZpvSbkMFiW8P3TR0v/BNNt8ZkylTWoSaA6YpZQj1j2zTP+kTyapQ44F3q4cQ== X-Received: by 2002:a17:906:d6:b0:99b:ed8f:551d with SMTP id 22-20020a17090600d600b0099bed8f551dmr8792958eji.55.1691414905079; Mon, 07 Aug 2023 06:28:25 -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 lg12-20020a170906f88c00b00992ca779f42sm5175257ejb.97.2023.08.07.06.28.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 06:28:24 -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 v10 08/12] ceph: pass idmap to __ceph_setattr Date: Mon, 7 Aug 2023 15:26:22 +0200 Message-Id: <20230807132626.182101-9-aleksandr.mikhalitsyn@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230807132626.182101-1-aleksandr.mikhalitsyn@canonical.com> References: <20230807132626.182101-1-aleksandr.mikhalitsyn@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Just pass down the mount's idmapping to __ceph_setattr, because we will need it later. Cc: Xiubo Li Cc: Jeff Layton Cc: Ilya Dryomov Cc: Christian Brauner Cc: ceph-devel@vger.kernel.org Signed-off-by: Alexander Mikhalitsyn Acked-by: Christian Brauner --- fs/ceph/acl.c | 4 ++-- fs/ceph/crypto.c | 2 +- fs/ceph/inode.c | 5 +++-- fs/ceph/super.h | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/fs/ceph/acl.c b/fs/ceph/acl.c index 32b26deb1741..89280c168acb 100644 --- a/fs/ceph/acl.c +++ b/fs/ceph/acl.c @@ -142,7 +142,7 @@ int ceph_set_acl(struct mnt_idmap *idmap, struct dentry= *dentry, newattrs.ia_ctime =3D current_time(inode); newattrs.ia_mode =3D new_mode; newattrs.ia_valid =3D ATTR_MODE | ATTR_CTIME; - ret =3D __ceph_setattr(inode, &newattrs, NULL); + ret =3D __ceph_setattr(idmap, inode, &newattrs, NULL); if (ret) goto out_free; } @@ -153,7 +153,7 @@ int ceph_set_acl(struct mnt_idmap *idmap, struct dentry= *dentry, newattrs.ia_ctime =3D old_ctime; newattrs.ia_mode =3D old_mode; newattrs.ia_valid =3D ATTR_MODE | ATTR_CTIME; - __ceph_setattr(inode, &newattrs, NULL); + __ceph_setattr(idmap, inode, &newattrs, NULL); } goto out_free; } diff --git a/fs/ceph/crypto.c b/fs/ceph/crypto.c index b9071bba3b08..8cf32e7f59bf 100644 --- a/fs/ceph/crypto.c +++ b/fs/ceph/crypto.c @@ -112,7 +112,7 @@ static int ceph_crypt_set_context(struct inode *inode, = const void *ctx, size_t l =20 cia.fscrypt_auth =3D cfa; =20 - ret =3D __ceph_setattr(inode, &attr, &cia); + ret =3D __ceph_setattr(&nop_mnt_idmap, inode, &attr, &cia); if (ret =3D=3D 0) inode_set_flags(inode, S_ENCRYPTED, S_ENCRYPTED); kfree(cia.fscrypt_auth); diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 9b50861bd2b5..6c4cc009d819 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -2466,7 +2466,8 @@ static int fill_fscrypt_truncate(struct inode *inode, return ret; } =20 -int __ceph_setattr(struct inode *inode, struct iattr *attr, struct ceph_ia= ttr *cia) +int __ceph_setattr(struct mnt_idmap *idmap, struct inode *inode, + struct iattr *attr, struct ceph_iattr *cia) { struct ceph_inode_info *ci =3D ceph_inode(inode); unsigned int ia_valid =3D attr->ia_valid; @@ -2818,7 +2819,7 @@ int ceph_setattr(struct mnt_idmap *idmap, struct dent= ry *dentry, ceph_quota_is_max_bytes_exceeded(inode, attr->ia_size)) return -EDQUOT; =20 - err =3D __ceph_setattr(inode, attr, NULL); + err =3D __ceph_setattr(idmap, inode, attr, NULL); =20 if (err >=3D 0 && (attr->ia_valid & ATTR_MODE)) err =3D posix_acl_chmod(&nop_mnt_idmap, dentry, attr->ia_mode); diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 4e78de1be23e..e729cde7b4a0 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -1101,7 +1101,8 @@ struct ceph_iattr { struct ceph_fscrypt_auth *fscrypt_auth; }; =20 -extern int __ceph_setattr(struct inode *inode, struct iattr *attr, struct = ceph_iattr *cia); +extern int __ceph_setattr(struct mnt_idmap *idmap, struct inode *inode, + struct iattr *attr, struct ceph_iattr *cia); extern int ceph_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr); extern int ceph_getattr(struct mnt_idmap *idmap, --=20 2.34.1