From patchwork Mon Feb 27 03:28:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiubo Li X-Patchwork-Id: 657843 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 38461C64ED6 for ; Mon, 27 Feb 2023 03:37:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230219AbjB0DhN (ORCPT ); Sun, 26 Feb 2023 22:37:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230079AbjB0DhM (ORCPT ); Sun, 26 Feb 2023 22:37:12 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D610D1C7CB for ; Sun, 26 Feb 2023 19:36:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677468937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iKd4wosAWyK6/yW3WeYLmMNUnP+qRTxkPIeBorWZIsk=; b=MGzXWFHC9eqjmAu77jypWy/1Kg0PlXFu6pgbPH+kF0kBxEm/tph4uNpS5gtqG93oMJSY5c 4qzmKuK9z3ZU0V+g+sJNNDixzzgdoacimuNad0ZBHkZ4f5ukga65bDFUn6Joxf/4HMxc0j e96PDOj+cLSXFlYhHBcqErG+W1P9Rd4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-60-ke0EdnxHNxKPiRZRFjeo9A-1; Sun, 26 Feb 2023 22:32:09 -0500 X-MC-Unique: ke0EdnxHNxKPiRZRFjeo9A-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7F7C0183B3C0; Mon, 27 Feb 2023 03:32:09 +0000 (UTC) Received: from lxbceph1.gsslab.pek2.redhat.com (unknown [10.72.47.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id B185335454; Mon, 27 Feb 2023 03:32:06 +0000 (UTC) From: xiubli@redhat.com To: idryomov@gmail.com, ceph-devel@vger.kernel.org Cc: jlayton@kernel.org, lhenriques@suse.de, vshankar@redhat.com, mchangir@redhat.com, Xiubo Li Subject: [PATCH v16 66/68] ceph: report STATX_ATTR_ENCRYPTED on encrypted inodes Date: Mon, 27 Feb 2023 11:28:11 +0800 Message-Id: <20230227032813.337906-67-xiubli@redhat.com> In-Reply-To: <20230227032813.337906-1-xiubli@redhat.com> References: <20230227032813.337906-1-xiubli@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org From: Jeff Layton Reviewed-by: Xiubo Li Signed-off-by: Jeff Layton --- fs/ceph/inode.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 696c4c826b0b..495415fada04 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -3008,6 +3008,10 @@ int ceph_getattr(struct user_namespace *mnt_userns, const struct path *path, stat->nlink = 1 + 1 + ci->i_subdirs; } + if (IS_ENCRYPTED(inode)) + stat->attributes |= STATX_ATTR_ENCRYPTED; + stat->attributes_mask |= STATX_ATTR_ENCRYPTED; + stat->result_mask = request_mask & valid_mask; return err; }