Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp586496ybh; Wed, 15 Jul 2020 09:45:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDMeQ3+QHU7hosx2aHUKdqMSQS6b45yvBCPW3m/5M34LupkgzdaJM9HcGFdnQ95t6spPdF X-Received: by 2002:a17:906:494a:: with SMTP id f10mr10638598ejt.428.1594831530680; Wed, 15 Jul 2020 09:45:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594831530; cv=none; d=google.com; s=arc-20160816; b=jLKj/FJCJwbDhkXkLMWYtASOkAHgcfN/Ugqj+3rQblPgk9QIu5R+9fWV/RSjKQIUuT BVNRmP3+R1tbVlb6gWtjx9q0KrHjPulo0+lA7aTrr3+aOKrhD4yx5vzqGJyJl5XsZ+KB bzDXHwzQq/meBpsLDbQocSOf44XcRNqQlwwqHJylFZeEyF6D7xiP2Ibb0dY8sGQ/fNsQ QitD0gDZzAFeF+CpPbhsjMgc89v9OjjNxNspBT0Z99DsFCs4jJySRJYcC+6uXIcCLJ16 2zsprpNiuipbkl13PHyNjyQMtc1Ci53cNhgwVJn+n773VjDlrFkZZpiqV/knhmB+qC2u 7UAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=F66Pz1zIyliX/dWUswzKGzCswBFwUjJgsk7DRRn2eUw=; b=SoaWkaIPI6gOFu75RRuniBcBiU+5iSKdEHtZhOCUnW0Jn1E/xGWn2PQr2arDuDZtP5 EVkzv+Q0ua+zwr4mgSmjQLdmrgax5TJdCy8HP7Qz7a9+YsSKkVEjkNcrEvJiTIN+p010 RRTI5BDt30cLcgH2tQfeBmZCSU3IOPiU0d+8lMQykZ2oyAq1tGrjwwpEb7MbDG3zNzbd /CESytDj77Yi1Yp8UKEEgL0e8+MR+7BMvysw1MPZXUCbSTDnS9gEA/dnezu0I4gJBQ8S 6IQNDYMBOp2nYkUfPsZR36IruZKOkj8YKYnfFMO6cFd1B1CvaI+e875qQH40fDpeMRfs wgbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dQA5TiCj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j10si1547785ejs.541.2020.07.15.09.45.06; Wed, 15 Jul 2020 09:45:30 -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; dkim=pass header.i=@kernel.org header.s=default header.b=dQA5TiCj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725861AbgGOQmY (ORCPT + 99 others); Wed, 15 Jul 2020 12:42:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:44200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725834AbgGOQmX (ORCPT ); Wed, 15 Jul 2020 12:42:23 -0400 Received: from sol.localdomain (c-107-3-166-239.hsd1.ca.comcast.net [107.3.166.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3798120658; Wed, 15 Jul 2020 16:42:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594831342; bh=ED5t9A4zYRl2ppiYuYOQoWbYJVj84a6IYOD4Vjh9qcw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dQA5TiCjdpTjdRjyFo64GaYmcJ38VZ98DmESuH3bIc7IwBm+v5kPqFNCfamABR9ad juc1949N82lTQqEXq8UtZ8CEbj9YS6CApPxNuKJZjUnXctZlMrROfyWVI3oPc7nkke bgJOSl8Vf6rDJvb6pGJKcpTQJ6zKF3hQOrGgCfOk= Date: Wed, 15 Jul 2020 09:42:20 -0700 From: Eric Biggers To: Daeho Jeong Cc: Chao Yu , Jaegeuk Kim , linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong , linux-kernel@vger.kernel.org Subject: Re: [f2fs-dev] [PATCH v2] f2fs: change the way of handling range.len in F2FS_IOC_SEC_TRIM_FILE Message-ID: <20200715164220.GC1167@sol.localdomain> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Just use fscrypt_zeroout_range(). - Eric