Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp860453ybh; Wed, 15 Jul 2020 18:06:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2m2hBNY0X+LnwUrxJPuhFLl1klCa+A6S3bb0AtIToc7ueR1Se4a72IgtxF9pMN1Hv6Xqu X-Received: by 2002:a05:6402:319b:: with SMTP id di27mr2212657edb.133.1594861615527; Wed, 15 Jul 2020 18:06:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594861615; cv=none; d=google.com; s=arc-20160816; b=UQ+HDYoR6E5250Cu9lrQVN4AHQof/pFvM7odzfDO5aygnG25rWR8nl+3qy5q5KvLSS NkX4nvyXZG8ILTZOcUfUQiqZLi5KbtToYITV3+Oqx7ss2pMlk062XmL14g+Y+n/d5tU7 o8ambm5aAcJsPbUhxBEizjSDIcPj1Fl4/b2PHmY9+TwYnAewuFsPxgf49VsX3Hx/opdw LYPiuX6om9NfC2g8l3FpFpb2JbVZcvcCOLMf2aSN1oOr5eR4O6lTMC0d3II83TiHr82Z xBWxnUeh/v3DeBW3PiokxJxH3AzozUVLfL1oFeSVN1nHXxEJibJlyWYbqANOK+NHwHsV UxLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=UQJObexPRsDsRi4bG8axIF/XVJQIZB1haavbfvslv48=; b=jliTI1cd3I467oXXrJWo1CNyhBAhGD2jJRIMlVpWa80NdowRgECIgXV/GFcD/6MBZs 8EmNajAzcOPKnbVJbKJLKzxFX8hCjyee5aPdRtcVptd7elMRyFTFQQHwqQ0jTS/iamyu 8Zj9q4oX+FYgHzC7QH+k4BLN1S4qyZTB1H8OjeSQFTpnziL2jy7+zQJ6i9KnmE0ghmnu C2+DZwrli+LkSBQwgkUU2uVtlWycNGrlnVt0A4Xtzqpyi39vslRy7TYMeRRIHOLQVARh O6Qc6XTZBWKXfRblMI/qn10ocMk6Rq3E2sXbZze6hNtxb3tugWUWfb2TyMArIIcMKpu1 osbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r23si2198530eja.287.2020.07.15.18.06.33; Wed, 15 Jul 2020 18:06:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727090AbgGPBEV (ORCPT + 99 others); Wed, 15 Jul 2020 21:04:21 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7755 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726479AbgGPBEV (ORCPT ); Wed, 15 Jul 2020 21:04:21 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 00D367C0197A199A374A; Thu, 16 Jul 2020 09:04:20 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.210) with Microsoft SMTP Server (TLS) id 14.3.487.0; Thu, 16 Jul 2020 09:04:16 +0800 Subject: Re: [f2fs-dev] [PATCH v2] f2fs: change the way of handling range.len in F2FS_IOC_SEC_TRIM_FILE To: Eric Biggers , Daeho Jeong CC: Jaegeuk Kim , , , "Daeho Jeong" , References: <20200713031252.3873546-1-daeho43@gmail.com> <20200713181152.GC2910046@google.com> <3b02263d-a5e1-136c-40ed-514d34e4c895@huawei.com> <1d84bc01-fece-df55-6e33-07a705cfb432@huawei.com> <20200715164220.GC1167@sol.localdomain> From: Chao Yu Message-ID: <78df7d19-2744-34df-73b3-3c4650db8771@huawei.com> Date: Thu, 16 Jul 2020 09:04:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200715164220.GC1167@sol.localdomain> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/7/16 0:42, Eric Biggers wrote: > On Wed, Jul 15, 2020 at 07:25:13PM +0900, Daeho Jeong wrote: >> Chao, >> >> I can't find fscrypt_zeroout_range_inline_crypt() function. Do you >> mean we need to implement this one for inline encryption? >> >> 2020년 7월 15일 (수) 오후 4:17, Chao Yu 님이 작성: >>> >>> On 2020/7/15 14:54, Daeho Jeong wrote: >>>> You mean we can support ZEROOUT option only for encrypted files of >>>> non-multidevice f2fs, >>>> and return -EOPNOTSUPP in the multidevice case, right now? >>> >>> Yes, something like: >>> >>> f2fs_sec_trim_file() >>> >>> if ((range.flags & F2FS_TRIM_FILE_ZEROOUT) && >>> f2fs_encrypted_file() && f2fs_is_multi_device()) >>> return -EOPNOTSUPP; >>> >>> >>> f2fs_secure_erase() >>> >>> if (!ret && (flags & F2FS_TRIM_FILE_ZEROOUT)) { >>> if (f2fs_encrypted_file()) { >>> if (fscrypt_inode_uses_fs_layer_crypto) >>> ret = fscrypt_zeroout_range(); >>> else >>> ret = fscrypt_zeroout_range_inline_crypt(); >>> } else { >>> ret = blkdev_issue_zeroout(); >>> } >>> } > > fscrypt_zeroout_range_inline_crypt() is being added by > "fscrypt: add inline encryption support", which is queued in the fscrypt tree > (the master branch of https://git.kernel.org/pub/scm/fs/fscrypt/fscrypt.git). > > But that's not actually relevant here because fscrypt_zeroout_range() calls > fscrypt_zeroout_range_inline_crypt() when needed. Oh, correct, thanks for pointing out. Thanks, > > Just use fscrypt_zeroout_range(). > > - Eric > . >