Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1001673ybh; Tue, 21 Jul 2020 13:13:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXq+wxPBo5alcG5V8K9gvesI4UjC9YjjX5xuGVhZ6v9uyEi/V0QGXoEoOn0M2h/YpHknx3 X-Received: by 2002:a17:906:7709:: with SMTP id q9mr26328190ejm.123.1595362409853; Tue, 21 Jul 2020 13:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595362409; cv=none; d=google.com; s=arc-20160816; b=DkX9t/uKUYJwmmMNweYq/zhB5/D7yrEyStaE0hA73h7WestwXlsf/nzGfrYdpTFupT jLOCDh3VsAScsznizLS6Pnpv3yKswW6nuGjMVPzahvTEKs9q0kg5AhnQaqDOo2gBZidR fBByQTepSwPThV6hOIfifngbiuzJJhVOH2OiRal/5onrZ+aUPwCyEsPaugfTCEDMdrUz +10nXpTN7qUUFUsyfYd7XuKGOI22YQD7USrxI86HoiNnlweyNQBbH6T/3y+A3wzS4E8B 7SkHz3/VGzSlG5PsEH4gT4C9owMgXIQFlLPbgL6Z8QgfCe9ZWnhVCefCgzjk8ZIHMreQ bYZw== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=fNskwB8qF7W/kWJV2APEOlfB4w2NNa+tbSq1/3qyd78=; b=r8g7RBmEjqQOPL3w5AojjDQXzfP5o9aV+5/hYnKhtBHRUVGIauXcOuKnVhdXvTKCG/ uit5dFNW27PDpINKP7+wAHqzPDXcP/rQPN9uApFSvkh3weof7V7zspc6xmSkVIYmdnS8 HdtjZM4mowl9h2rn8IJkOPeofPmtKxmIyAozHx5auA2y8Cf4bcqDgodvtX6HQqLmAKH0 K/mShqUKKsIdpucC/DwoZ1GW56qrQtzZD1h5aaQQ3TckRPZmxPXqNLdu2VoRfPPm1h3u s+8EqQP1cogvzQ+Sthv8wI6lO0jdPsfozNej0QHxVzQOU8+bEcAzNWsKHtc+z34J7Uc6 FjQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="bMWyWlB/"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 dr17si4459469ejc.520.2020.07.21.13.12.57; Tue, 21 Jul 2020 13:13:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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="bMWyWlB/"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 S1726686AbgGUULp (ORCPT + 99 others); Tue, 21 Jul 2020 16:11:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:44556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726029AbgGUULo (ORCPT ); Tue, 21 Jul 2020 16:11:44 -0400 Received: from localhost (unknown [104.132.1.66]) (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 066C320684; Tue, 21 Jul 2020 20:11:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595362304; bh=qoQKgWZhAvGtgKCUrR3MgpQoIvX416jAmXkYrTf5C4o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bMWyWlB/11MTlbsMxh/UBrlE+PK1UfU+8098QuYaeXP4gnmt57SZVQ4oHkG5Bmx7c y37NhSgDyEyTuRp2QUZ0i/ZCMWvbKfqv2HTlM7bvw7DIE9G9y9s15zy03EMcbENl7E Yyq19zoKHdpAYxs4E/ewwfdjJbbRCSXhjDWvFOtw= Date: Tue, 21 Jul 2020 13:11:43 -0700 From: Jaegeuk Kim To: Satya Tangirala Cc: linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, Eric Biggers Subject: Re: [PATCH v4 5/7] f2fs: support direct I/O with fscrypt using blk-crypto Message-ID: <20200721201143.GB43066@google.com> References: <20200720233739.824943-1-satyat@google.com> <20200720233739.824943-6-satyat@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200720233739.824943-6-satyat@google.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 07/20, Satya Tangirala wrote: > From: Eric Biggers > > Wire up f2fs with fscrypt direct I/O support. direct I/O with fscrypt is > only supported through blk-crypto (i.e. CONFIG_BLK_INLINE_ENCRYPTION must > have been enabled, the 'inlinecrypt' mount option must have been specified, > and either hardware inline encryption support must be present or > CONFIG_BLK_INLINE_ENCYRPTION_FALLBACK must have been enabled). Further, > direct I/O on encrypted files is only supported when I/O is aligned > to the filesystem block size (which is *not* necessarily the same as the > block device's block size). > > Signed-off-by: Eric Biggers > Co-developed-by: Satya Tangirala > Signed-off-by: Satya Tangirala Acked-by: Jaegeuk Kim > --- > fs/f2fs/f2fs.h | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h > index b35a50f4953c..978130b5a195 100644 > --- a/fs/f2fs/f2fs.h > +++ b/fs/f2fs/f2fs.h > @@ -4082,7 +4082,11 @@ static inline bool f2fs_force_buffered_io(struct inode *inode, > struct f2fs_sb_info *sbi = F2FS_I_SB(inode); > int rw = iov_iter_rw(iter); > > - if (f2fs_post_read_required(inode)) > + if (!fscrypt_dio_supported(iocb, iter)) > + return true; > + if (fsverity_active(inode)) > + return true; > + if (f2fs_compressed_file(inode)) > return true; > if (f2fs_is_multi_device(sbi)) > return true; > -- > 2.28.0.rc0.105.gf9edc3c819-goog