public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Xiubo Li <xiubli@redhat.com>
To: Zorro Lang <zlang@redhat.com>
Cc: fstests@vger.kernel.org, david@fromorbit.com, djwong@kernel.org,
	lhenriques@suse.de, ceph-devel@vger.kernel.org,
	jlayton@kernel.org, mchangir@redhat.com
Subject: Re: [PATCH 2/2] encrypt: add ceph support
Date: Thu, 27 Oct 2022 10:22:13 +0800	[thread overview]
Message-ID: <9a8eaafa-fb5e-72dc-359e-edfb7cf5b954@redhat.com> (raw)
In-Reply-To: <20221026141218.wg2h3ganvo2dx7hb@zlang-mailbox>


On 26/10/2022 22:12, Zorro Lang wrote:
> On Wed, Oct 26, 2022 at 03:04:18PM +0800, xiubli@redhat.com wrote:
>> From: Xiubo Li <xiubli@redhat.com>
>>
>> For ceph we couldn't use the mkfs to check whether the encryption
>> is support or not, we need to mount it first and then check the
>> 'set_encpolicy', etc.
>>
>> Signed-off-by: Xiubo Li <xiubli@redhat.com>
>> ---
>>   common/encrypt | 17 +++++++++++++++++
>>   1 file changed, 17 insertions(+)
>>
>> diff --git a/common/encrypt b/common/encrypt
>> index fd620c41..e837c9de 100644
>> --- a/common/encrypt
>> +++ b/common/encrypt
>> @@ -153,6 +153,23 @@ _scratch_check_encrypted()
>>   		# erase the UBI volume; reformated automatically on next mount
>>   		$UBIUPDATEVOL_PROG ${SCRATCH_DEV} -t
>>   		;;
>> +	ceph)
>> +		# Try to mount the filesystem. We need to check whether the encryption
>> +		# is support or not via the ioctl cmd, such as 'set_encpolicy'.
>> +		if ! _try_scratch_mount &>>$seqres.full; then
>> +			_notrun "kernel is unaware of $FSTYP encryption feature," \
>> +				"or mkfs options are not compatible with encryption"
>> +		fi
>> +
>> +		mkdir $SCRATCH_MNT/tmpdir
>> +		if _set_encpolicy $SCRATCH_MNT/tmpdir 2>&1 >>$seqres.full | \
>> +			grep -Eq 'Inappropriate ioctl for device|Operation not supported'
>> +		then
>> +			_notrun "kernel does not support $FSTYP encryption"
>> +		fi
>> +		rmdir $SCRATCH_MNT/tmpdir
>> +		_scratch_unmount
> As I replied in patch 1/2, this function is a mkfs function, if ceph need a
> specific mkfs way, you can do it in this function, or you even can keep it
> empty
>
>    ceph)
> 	;;
>
> Or does a simple cleanup
>
>    ceph)
> 	_scratch_cleanup_files
> 	...
> 	;;
>
> I'm not familar with ceph, that depends on you. But the change in this patch is
> not "mkfs", it's a checking, checking if the current $SCRATCH_MNT supports
> encryption, you should do it in other function which does that checking job, not
> change a mkfs function to be a check function.

Sounds good. Let me check how to that.

Thanks Zorro again.

- Xiubo


> Thanks,
> Zorro
>
>> +		;;
>>   	*)
>>   		_notrun "No encryption support for $FSTYP"
>>   		;;
>> -- 
>> 2.31.1
>>


      reply	other threads:[~2022-10-27  2:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26  7:04 [PATCH 0/2] encrypt: add ceph support xiubli
2022-10-26  7:04 ` [PATCH 1/2] encrypt: rename _scratch_mkfs_encrypted to _scratch_check_encrypted xiubli
2022-10-26 14:04   ` Zorro Lang
2022-10-27  2:19     ` Xiubo Li
2022-10-26  7:04 ` [PATCH 2/2] encrypt: add ceph support xiubli
2022-10-26 14:12   ` Zorro Lang
2022-10-27  2:22     ` Xiubo Li [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a8eaafa-fb5e-72dc-359e-edfb7cf5b954@redhat.com \
    --to=xiubli@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=jlayton@kernel.org \
    --cc=lhenriques@suse.de \
    --cc=mchangir@redhat.com \
    --cc=zlang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox