[f2fs-dev] [PATCH v8 00/11] Inline Encryption Support

2020-03-12 Thread Satya Tangirala via Linux-f2fs-devel
This patch series adds support for Inline Encryption to the block layer, UFS, fscrypt, f2fs and ext4. Note that the patches in this series for the block layer (i.e. patches 1, 2, 3 and 4) can be applied independently of the subsequent patches in this series. Inline Encryption hardware allows soft

[f2fs-dev] [PATCH v8 01/11] block: Keyslot Manager for Inline Encryption

2020-03-12 Thread Satya Tangirala via Linux-f2fs-devel
Inline Encryption hardware allows software to specify an encryption context (an encryption key, crypto algorithm, data unit num, data unit size) along with a data transfer request to a storage device, and the inline encryption hardware will use that context to en/decrypt the data. The inline encryp

[f2fs-dev] [PATCH v8 06/11] scsi: ufs: UFS crypto API

2020-03-12 Thread Satya Tangirala via Linux-f2fs-devel
Introduce functions to manipulate UFS inline encryption hardware in line with the JEDEC UFSHCI v2.1 specification and to work with the block keyslot manager. The UFS crypto API will assume by default that a vendor driver doesn't support UFS crypto, even if the hardware advertises the capability, b

[f2fs-dev] [PATCH v8 09/11] fscrypt: add inline encryption support

2020-03-12 Thread Satya Tangirala via Linux-f2fs-devel
Add support for inline encryption to fs/crypto/. With "inline encryption", the block layer handles the decryption/encryption as part of the bio, instead of the filesystem doing the crypto itself via Linux's crypto API. This model is needed in order to take advantage of the inline encryption hardw

[f2fs-dev] [PATCH v8 08/11] fs: introduce SB_INLINECRYPT

2020-03-12 Thread Satya Tangirala via Linux-f2fs-devel
Introduce SB_INLINECRYPT, which is set by filesystems that wish to use blk-crypto for file content en/decryption. Signed-off-by: Satya Tangirala --- fs/proc_namespace.c | 1 + include/linux/fs.h | 1 + 2 files changed, 2 insertions(+) diff --git a/fs/proc_namespace.c b/fs/proc_namespace.c inde

[f2fs-dev] [PATCH v8 05/11] scsi: ufs: UFS driver v2.1 spec crypto additions

2020-03-12 Thread Satya Tangirala via Linux-f2fs-devel
Add the crypto registers and structs defined in v2.1 of the JEDEC UFSHCI specification in preparation to add support for inline encryption to UFS. Signed-off-by: Satya Tangirala --- drivers/scsi/ufs/ufshcd.c | 2 ++ drivers/scsi/ufs/ufshcd.h | 5 +++ drivers/scsi/ufs/ufshci.h | 67

[f2fs-dev] [PATCH v8 10/11] f2fs: add inline encryption support

2020-03-12 Thread Satya Tangirala via Linux-f2fs-devel
Wire up f2fs to support inline encryption via the helper functions which fs/crypto/ now provides. This includes: - Adding a mount option 'inlinecrypt' which enables inline encryption on encrypted files where it can be used. - Setting the bio_crypt_ctx on bios that will be submitted to an inl

[f2fs-dev] [PATCH v8 07/11] scsi: ufs: Add inline encryption support to UFS

2020-03-12 Thread Satya Tangirala via Linux-f2fs-devel
Wire up ufshcd.c with the UFS Crypto API, the block layer inline encryption additions and the keyslot manager. Signed-off-by: Satya Tangirala --- drivers/scsi/ufs/ufshcd-crypto.c | 27 +++ drivers/scsi/ufs/ufshcd-crypto.h | 14 drivers/scsi/ufs/ufshcd.c| 59 +

[f2fs-dev] [PATCH v8 02/11] block: Inline encryption support for blk-mq

2020-03-12 Thread Satya Tangirala via Linux-f2fs-devel
We must have some way of letting a storage device driver know what encryption context it should use for en/decrypting a request. However, it's the upper layers (like the filesystem/fscrypt) that know about and manages encryption contexts. As such, when the upper layer submits a bio to the block lay

[f2fs-dev] [PATCH v8 04/11] block: blk-crypto-fallback for Inline Encryption

2020-03-12 Thread Satya Tangirala via Linux-f2fs-devel
Blk-crypto delegates crypto operations to inline encryption hardware when available. The separately configurable blk-crypto-fallback contains a software fallback to the kernel crypto API - when enabled, blk-crypto will use this fallback for en/decryption when inline encryption hardware is not avail

[f2fs-dev] [PATCH v8 03/11] block: Make blk-integrity preclude hardware inline encryption

2020-03-12 Thread Satya Tangirala via Linux-f2fs-devel
Whenever a device supports blk-integrity, the kernel will now always pretend that the device doesn't support inline encryption (essentially by setting the keyslot manager in the request queue to NULL). There's no hardware currently that supports both integrity and inline encryption. However, it se

Re: [f2fs-dev] [man-pages PATCH v2] statx.2: document STATX_ATTR_VERITY

2020-03-12 Thread Michael Kerrisk (man-pages)
Hello Eric, On 1/28/20 8:24 PM, Eric Biggers wrote: > From: Eric Biggers > > Document the verity attribute for statx(), which was added in > Linux 5.5. > > For more context, see the fs-verity documentation: > https://www.kernel.org/doc/html/latest/filesystems/fsverity.html Thanks for the patch

[f2fs-dev] [PATCH v8 11/11] ext4: add inline encryption support

2020-03-12 Thread Satya Tangirala via Linux-f2fs-devel
From: Eric Biggers Wire up ext4 to support inline encryption via the helper functions which fs/crypto/ now provides. This includes: - Adding a mount option 'inlinecrypt' which enables inline encryption on encrypted files where it can be used. - Setting the bio_crypt_ctx on bios that will be

Re: [f2fs-dev] [PATCH] writeback: avoid double-writing the inode on a lazytime expiration

2020-03-12 Thread Christoph Hellwig
On Thu, Mar 12, 2020 at 11:07:17AM +1100, Dave Chinner wrote: > > That's true, but when the timestamps were originally modified, > > dirty_inode() will be called with flag == I_DIRTY_TIME, which will > > *not* be a no-op; which is to say, XFS will force the timestamps to be > > updated on disk when

Re: [f2fs-dev] [PATCH v8 00/11] Inline Encryption Support

2020-03-12 Thread Eric Biggers
On Thu, Mar 12, 2020 at 01:02:42AM -0700, Satya Tangirala wrote: > This patch series adds support for Inline Encryption to the block layer, > UFS, fscrypt, f2fs and ext4. > This patch series can also be retrieved from Repo: https://git.kernel.org/pub/scm/fs/fscrypt/fscrypt.git Ta

Re: [f2fs-dev] [PATCH] f2fs: fix long latency due to discard during umount

2020-03-12 Thread Jaegeuk Kim
On 03/12, Sahitya Tummala wrote: > F2FS already has a default timeout of 5 secs for discards that > can be issued during umount, but it can take more than the 5 sec > timeout if the underlying UFS device queue is already full and there > are no more available free tags to be used. In that case, sub

Re: [f2fs-dev] [PATCH v8 2/8] fs: Add standard casefolding support

2020-03-12 Thread Daniel Rosenberg via Linux-f2fs-devel
On Fri, Mar 6, 2020 at 7:48 PM Al Viro wrote: > > On Fri, Mar 06, 2020 at 06:36:05PM -0800, Daniel Rosenberg wrote: > > Have you even tested that? Could you tell me where does the > calculated > hash go? And just what is it doing trying to check if the name we are about > to > look up

Re: [f2fs-dev] [PATCH] writeback: avoid double-writing the inode on a lazytime expiration

2020-03-12 Thread Dave Chinner
On Thu, Mar 12, 2020 at 07:34:45AM -0700, Christoph Hellwig wrote: > On Thu, Mar 12, 2020 at 11:07:17AM +1100, Dave Chinner wrote: > > > That's true, but when the timestamps were originally modified, > > > dirty_inode() will be called with flag == I_DIRTY_TIME, which will > > > *not* be a no-op; wh

Re: [f2fs-dev] [PATCH] f2fs: fix long latency due to discard during umount

2020-03-12 Thread Jaegeuk Kim
On 03/13, Sahitya Tummala wrote: > On Thu, Mar 12, 2020 at 10:02:42AM -0700, Jaegeuk Kim wrote: > > On 03/12, Sahitya Tummala wrote: > > > F2FS already has a default timeout of 5 secs for discards that > > > can be issued during umount, but it can take more than the 5 sec > > > timeout if the under

Re: [f2fs-dev] [PATCH] f2fs: fix long latency due to discard during umount

2020-03-12 Thread Chao Yu
On 2020/3/12 19:14, Sahitya Tummala wrote: > F2FS already has a default timeout of 5 secs for discards that > can be issued during umount, but it can take more than the 5 sec > timeout if the underlying UFS device queue is already full and there > are no more available free tags to be used. In that

Re: [f2fs-dev] [PATCH] f2fs: fix long latency due to discard during umount

2020-03-12 Thread Sahitya Tummala
On Thu, Mar 12, 2020 at 06:45:35PM -0700, Jaegeuk Kim wrote: > On 03/13, Sahitya Tummala wrote: > > On Thu, Mar 12, 2020 at 10:02:42AM -0700, Jaegeuk Kim wrote: > > > On 03/12, Sahitya Tummala wrote: > > > > F2FS already has a default timeout of 5 secs for discards that > > > > can be issued during

Re: [f2fs-dev] [PATCH] f2fs: fix long latency due to discard during umount

2020-03-12 Thread Chao Yu
On 2020/3/13 11:39, Sahitya Tummala wrote: > On Fri, Mar 13, 2020 at 10:20:04AM +0800, Chao Yu wrote: >> On 2020/3/12 19:14, Sahitya Tummala wrote: >>> F2FS already has a default timeout of 5 secs for discards that >>> can be issued during umount, but it can take more than the 5 sec >>> timeout if