Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1242035pxm; Sat, 26 Feb 2022 09:23:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJxPbQru8kOzb33pXrHgcZvoP9rUbTdrcB4yRR4fiAm6cpwHTBOMcTgxNrjYIrAHBDoSz0kf X-Received: by 2002:a17:906:c787:b0:6cd:e855:b20e with SMTP id cw7-20020a170906c78700b006cde855b20emr10257645ejb.221.1645896233075; Sat, 26 Feb 2022 09:23:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645896233; cv=none; d=google.com; s=arc-20160816; b=HXPqHGX0nwTQzoaL+9O3f8Tv4h4SjlSPI852AACQtoxnVfBgUnhW/5t2/HZgJ4ElBT R3RH8DxaHSzFnM65licLuHo+UC2wJw9RTQeGuZiQymDEE5wTPs1uR7vfU27/53anQxJY sK+Kd17FGZs9qM1I2yOnPcvCgTfdl0OibDUpp8JpG4+QMrUYYi29JZ6778Z1vQmDF7b9 o5DOn8wrGgjfq5D0iPDtF7QASOm1wZZcGRWhqqpCRp39wYOIHaFh6qm6nM8tw4e8f4CJ 5JfMr+xD+KhhzgRcD8wuqKYEFGKKLZTDdojbTB3Xdu4IjUETpzIQWMzQsLQUAcQ4jhtW A7pg== 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:in-reply-to:date:references:subject:cc:to:from :dkim-signature:dkim-signature; bh=LefhXVnqyz+mRM1nIuQbTrG++HxjZH7DvWFaUe2wKUY=; b=xqmnTWC6vD0wQ10IVrOJGMDlgbNId8R/G8kaUyjS616ArZ7NuLL4WbVePkEV4MXc5n 8raNK5fryVKN3hgyJ9Hvczmh9VathOS3DtCWPVwXklx0jNGG6rl+TSVolZqUIgkg0V7k 0PKvmHLYrZ1uiEAgk+D7DyYk4WcMlAIcQv76Sk8DY59JeKgFLXfTgnqQjRMvBSdArfEd lgwWwO7Ztm248n+fcEcVK8MkGZHvzg+o7VUeot/X7//pnBgS2XjHFQKUcJoyR4866V90 jbP+pqTUCof3nhEEsM5Rvlg3/9zqdxAaXKX/ILduzucfPOIsJHT+QRqc5E4gnCSctTQx vXrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=FQMHIFeC; dkim=neutral (no key) header.i=@suse.de header.b="Wj/B4Mf1"; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 5-20020a508e45000000b0040f5ee891c3si4729313edx.36.2022.02.26.09.23.28; Sat, 26 Feb 2022 09:23:53 -0800 (PST) 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=@suse.de header.s=susede2_rsa header.b=FQMHIFeC; dkim=neutral (no key) header.i=@suse.de header.b="Wj/B4Mf1"; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232103AbiBZO6u (ORCPT + 99 others); Sat, 26 Feb 2022 09:58:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbiBZO6s (ORCPT ); Sat, 26 Feb 2022 09:58:48 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87A1C52B0D; Sat, 26 Feb 2022 06:58:13 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 02E1C1F38C; Sat, 26 Feb 2022 14:58:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1645887492; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LefhXVnqyz+mRM1nIuQbTrG++HxjZH7DvWFaUe2wKUY=; b=FQMHIFeCjYGsD8uQW/zKu8oMdQgYOGiEJc8n7NxlZZ1+MYmXFQqX3H4zYbjs8HVC6kQa1S wOp58wy+rvslv3Az0crUY6aAtIurU104LohrhKdm9kRLfEX6XDRIOM5GbKfEuek3ea4x4M etQ04+QlRRMQkkRjyKIJEKTVduKBnqg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1645887492; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LefhXVnqyz+mRM1nIuQbTrG++HxjZH7DvWFaUe2wKUY=; b=Wj/B4Mf1amZa8mxBuLRMOUNjiWgAtfkVedLNr6fidAXCzEBmZk5EngtPNFaQ4X4YCpUL3b yZZcyVblh8mU5NBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 952FD1351D; Sat, 26 Feb 2022 14:58:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0hOxIANAGmI3LgAAMHmgww (envelope-from ); Sat, 26 Feb 2022 14:58:11 +0000 Received: from localhost (brahms.olymp [local]) by brahms.olymp (OpenSMTPD) with ESMTPA id 333fd66b; Sat, 26 Feb 2022 14:58:25 +0000 (UTC) From: =?utf-8?Q?Lu=C3=ADs_Henriques?= To: Xiubo Li Cc: Jeff Layton , Ilya Dryomov , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] ceph: add support for encrypted snapshot names References: <20220224112142.18052-1-lhenriques@suse.de> <7d2a798d-ce32-4bf7-b184-267bb79f44e3@redhat.com> <87h78ni8ed.fsf@brahms.olymp> <3bc5797e-f23e-6416-4626-161e34c409ff@redhat.com> Date: Sat, 26 Feb 2022 14:58:25 +0000 In-Reply-To: <3bc5797e-f23e-6416-4626-161e34c409ff@redhat.com> (Xiubo Li's message of "Sat, 26 Feb 2022 14:52:12 +0800") Message-ID: <871qzpu12m.fsf@brahms.olymp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Xiubo Li writes: > On 2/25/22 5:48 PM, Lu=C3=ADs Henriques wrote: >> Xiubo Li writes: >> >>> On 2/24/22 7:21 PM, Lu=C3=ADs Henriques wrote: >>>> Since filenames in encrypted directories are already encrypted and sho= wn >>>> as a base64-encoded string when the directory is locked, snapshot names >>>> should show a similar behaviour. >>>> >>>> Signed-off-by: Lu=C3=ADs Henriques >>>> --- >>>> fs/ceph/dir.c | 15 +++++++++++++++ >>>> fs/ceph/inode.c | 10 +++++++++- >>>> 2 files changed, 24 insertions(+), 1 deletion(-) >>>> >>>> Support on the MDS for names that'll be > MAX_NAME when base64 encoded= is >>>> still TBD. I thought it would be something easy to do, but snapshots >>>> don't seem to make use of the CDir/CDentry (which is where alternate_n= ame >>>> is stored on the MDS). I'm still looking into this, but I may need so= me >>>> help there :-( >>>> >>>> Cheers, >>>> -- >>>> Lu=C3=ADs >>>> >>>> diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c >>>> index a449f4a07c07..20ae600ee7cd 100644 >>>> --- a/fs/ceph/dir.c >>>> +++ b/fs/ceph/dir.c >>>> @@ -1065,6 +1065,13 @@ static int ceph_mkdir(struct user_namespace *mn= t_userns, struct inode *dir, >>>> op =3D CEPH_MDS_OP_MKSNAP; >>>> dout("mksnap dir %p snap '%pd' dn %p\n", dir, >>>> dentry, dentry); >>>> + /* XXX missing support for alternate_name in snapshots */ >>>> + if (IS_ENCRYPTED(dir) && (dentry->d_name.len >=3D 189)) { >>>> + dout("encrypted snapshot name too long: %pd len: %d\n", >>>> + dentry, dentry->d_name.len); >>>> + err =3D -ENAMETOOLONG; >>>> + goto out; >>>> + } >>>> } else if (ceph_snap(dir) =3D=3D CEPH_NOSNAP) { >>>> dout("mkdir dir %p dn %p mode 0%ho\n", dir, dentry, mode); >>>> op =3D CEPH_MDS_OP_MKDIR; >>>> @@ -1109,6 +1116,14 @@ static int ceph_mkdir(struct user_namespace *mn= t_userns, struct inode *dir, >>>> !req->r_reply_info.head->is_target && >>>> !req->r_reply_info.head->is_dentry) >>>> err =3D ceph_handle_notrace_create(dir, dentry); >>>> + >>>> + /* >>>> + * If we have created a snapshot we need to clear the cache, otherwi= se >>>> + * snapshot will show encrypted filenames in readdir. >>>> + */ >>> Do you mean dencrypted filenames ? >> What I see without this d_drop() is that, if I run an 'ls' in a snapshot >> directory immediately after creating it, the filenames in that snapshot >> will be encrypted. Maybe there's a bug somewhere else and this d_drop() >> isn't the right fix...? > > BTW, how did you reproduce this ? > > The snapshot name hasn't encrypted yet ? Did you add one patch to do this= ? I don't think I understand what you're referring to. I haven't looked into you patch (probably won't be able to do in before Wednesday) but if you remove the d_drop() in ceph_mkdir() in this patch, here's what I use to reproduce the issue: # mkdir mydir # fscrypt encrypt mydir # cd mydir # create a few files # mkdir .snap/snapshot-01 # ls -l .snap/snapshot-01 And this would show the contents 'snapshot-01' but with the filenames encrypted, even with 'mydir' isn't locked. With this d_drop(), this behaviour will go away, i.e. you'll see the correct (unencrypted) filenames. Also, after locking 'mydir' (fscrypt lock mydir), an 'ls' in the snapshot directory ('ls mydir/.snap') will show the _encrypted_ snapshot names and an 'ls' in the snapshot itself ('ls mydir/.snap/') will show the encrypted filenames as in an 'ls mydir'. Cheers, --=20 Lu=C3=ADs > Locally I have one patch to support this, but not finished yet: > > > diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c > index 914a6e68bb56..bc9b2b0c9c66 100644 > --- a/fs/ceph/mds_client.c > +++ b/fs/ceph/mds_client.c > @@ -2464,7 +2464,7 @@ static u8 *get_fscrypt_altname(const struct > ceph_mds_request *req, u32 *plen) > =C2=A0char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *p= base, int > for_wire) > =C2=A0{ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct dentry *cur; > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct inode *inode; > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct inode *inode, *pinode =3D NU= LL; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 char *path; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int pos; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned seq; > @@ -2485,18 +2485,29 @@ char *ceph_mdsc_build_path(struct dentry *dentry,= int > *plen, u64 *pbase, int for > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (;;) { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 struct dentry *parent; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 parent =3D dget_parent(cur); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 spin_lock(&cur->d_lock); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 pinode =3D d_inode(parent); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 ihold(pinode); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 if (ceph_snap(pinode) =3D=3D CEPH_SNAPDIR) { > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct ceph_vi= no vino =3D { > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0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ceph_snap(inode) =3D=3D CEPH_SNAPDIR) { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 dout("bu= ild_path path+%d: %p SNAPDIR\n", > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 pos, cur); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 spin_unl= ock(&cur->d_lock); > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 parent =3D dge= t_parent(cur); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 } else if (for_wire && inode && dentry !=3D cur && > ceph_snap(inode) =3D=3D CEPH_NOSNAP) { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 spin_unl= ock(&cur->d_lock); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pos++; /= * get rid of any prepended '/' */ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 } else if (!for_wire || !IS_ENCRYPTED(d_inode(cur->d_parent)))= { > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 } else if (!for_wire || !IS_ENCRYPTED(pinode)) { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pos -=3D= cur->d_name.len; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (pos = < 0) { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 spin_unlock(&cur->d_lock); > @@ -2504,7 +2515,6 @@ char *ceph_mdsc_build_path(struct dentry *dentry, i= nt > *plen, u64 *pbase, int for > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 memcpy(p= ath + pos, cur->d_name.name, cur->d_name.len); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 spin_unl= ock(&cur->d_lock); > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 parent =3D dge= t_parent(cur); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 } else { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int len,= ret; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 char buf= [FSCRYPT_BASE64URL_CHARS(NAME_MAX)]; > @@ -2516,20 +2526,21 @@ char *ceph_mdsc_build_path(struct dentry *dentry,= int > *plen, u64 *pbase, int for > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 memcpy(b= uf, cur->d_name.name, cur->d_name.len); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 len =3D = cur->d_name.len; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 spin_unl= ock(&cur->d_lock); > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 parent =3D dge= t_parent(cur); > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret =3D __fscr= ypt_prepare_readdir(d_inode(parent)); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=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ret); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (fscrypt_ha= s_encryption_key(d_inode(parent))) { > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 len =3D > ceph_encode_encrypted_fname(d_inode(parent), cur, buf); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (fscrypt_ha= s_encryption_key(pinode)) { > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 len =3D ceph_encode_encrypted_fname(pinod= e, cur, > buf); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0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A0=C2=A0=C2=A0= =C2=A0=C2=A0 return ERR_PTR(len); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } > @@ -2552,7 +2563,11 @@ char *ceph_mdsc_build_path(struct dentry *dentry, = int > *plen, u64 *pbase, int for > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 path[pos] =3D '/'; > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 iput(pinode); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 pinode =3D NULL; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (pinode) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 iput(pinode); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 inode =3D d_inode(cur); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 base =3D inode ? ceph_ino(inod= e) : 0; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 dput(cur); > > > Are you doing the same thing too ? If so I will leave this to you, or I c= an send > one patch to support it. > > Thanks > > - Xiubo > > > > >> Cheers, >