android_kernel_motorola_sm6375/fs/ext4
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Eric Biggers 8de6a8d30b ANDROID: fscrypt: handle direct I/O with IV_INO_LBLK_32
With the existing fscrypt IV generation methods, each file's data blocks
have contiguous DUNs.  Therefore the direct I/O code "just worked"
because it only submits logically contiguous bios.  But with
IV_INO_LBLK_32, the direct I/O code breaks because the DUN can wrap from
0xffffffff to 0.  We can't submit bios across such boundaries.

This is especially difficult to handle when block_size != PAGE_SIZE,
since in that case the DUN can wrap in the middle of a page.  Punt on
this case for now and just handle block_size == PAGE_SIZE.

Add and use a new function fscrypt_dio_supported() to check whether a
direct I/O request is unsupported due to encryption constraints.

Then, update fs/direct-io.c (used by f2fs, and by ext4 in kernel v5.4
and earlier) and fs/iomap/direct-io.c (used by ext4 in kernel v5.5 and
later) to avoid submitting I/O across a DUN discontinuity.

(This is needed in ACK now because ACK already supports direct I/O with
inline crypto.  I'll be sending this upstream along with the encrypted
direct I/O support itself once its prerequisites are closer to landing.)

(cherry picked from android-mainline commit
 8d6c90c9d68b985fa809626d12f8c9aff3c9dcb1)

Conflicts:
	fs/ext4/file.c
	fs/iomap/direct-io.c

(Dropped the iomap changes because in kernel v5.4 and earlier,
 ext4 doesn't use iomap for direct I/O)

Test: For now, just manually tested direct I/O on ext4 and f2fs in the
      DUN discontinuity case.
Bug: 144046242
Change-Id: I0c0b0b20a73ade35c3660cc6f9c09d49d3853ba5
Signed-off-by: Eric Biggers <ebiggers@google.com>
2020-05-21 11:52:18 -07:00
..
acl.c
acl.h
balloc.c ext4: fix potential race between online resizing and write operations 2020-02-28 17:22:22 +01:00
bitmap.c
block_validity.c ext4: add cond_resched() to ext4_protect_reserved_inode 2020-02-19 19:52:59 +01:00
dir.c FROMLIST: fscrypt: Have filesystems handle their d_ops 2020-02-20 21:21:40 +00:00
ext4.h This is the 5.4.23 stable release 2020-03-01 10:17:44 +01:00
ext4_extents.h
ext4_jbd2.c
ext4_jbd2.h
extents.c ext4: fix extent_status fragmentation for plain files 2020-04-29 16:32:55 +02:00
extents_status.c ext4: use percpu_counters for extent_status cache hits/misses 2019-08-28 11:19:23 -04:00
extents_status.h ext4: use percpu_counters for extent_status cache hits/misses 2019-08-28 11:19:23 -04:00
file.c ext4: fix ext4_dax_read/write inode locking sequence for IOCB_NOWAIT 2020-02-24 08:36:24 +01:00
fsmap.c
fsmap.h
fsync.c
hash.c FROMLIST: ext4: Use generic casefolding support 2020-02-20 21:21:30 +00:00
ialloc.c ext4: increase wait time needed before reuse of deleted inode numbers 2020-05-02 08:48:59 +02:00
indirect.c
inline.c Merge 5.4-rc1-prereleae into android-mainline 2019-09-23 14:14:08 +02:00
inode.c ANDROID: fscrypt: handle direct I/O with IV_INO_LBLK_32 2020-05-21 11:52:18 -07:00
ioctl.c FROMLIST: ext4: wire up FS_IOC_GET_ENCRYPTION_NONCE 2020-03-19 11:29:03 -07:00
Kconfig fscrypt: Allow modular crypto algorithms 2020-02-13 15:02:40 -08:00
Makefile ext4: add basic fs-verity support 2019-08-12 19:33:50 -07:00
mballoc.c ext4: convert BUG_ON's to WARN_ON's in mballoc.c 2020-05-02 08:48:59 +02:00
mballoc.h
migrate.c ext4: fix race between writepages and enabling EXT4_EXTENTS_FL 2020-02-28 17:22:23 +01:00
mmp.c ext4: don't assume that mmp_nodename/bdevname have NUL 2020-02-19 19:52:58 +01:00
move_extent.c
namei.c This is the 5.4.23 stable release 2020-03-01 10:17:44 +01:00
page-io.c This is the 5.4.19 stable release 2020-02-11 14:09:41 -08:00
readpage.c This is the 5.4.22 stable release 2020-02-24 09:16:10 +01:00
resize.c ext4: fix potential race between s_flex_groups online resizing and access 2020-02-28 17:22:22 +01:00
super.c This is the 5.4.37 stable release 2020-05-02 09:01:51 +02:00
symlink.c
sysfs.c ext4: add basic fs-verity support 2019-08-12 19:33:50 -07:00
truncate.h
verity.c fs-verity: implement readahead of Merkle tree pages 2020-02-13 15:02:43 -08:00
xattr.c
xattr.h
xattr_security.c FROMLIST: Add flags option to get xattr method paired to __vfs_getxattr 2019-11-05 13:50:57 -08:00
xattr_trusted.c FROMLIST: Add flags option to get xattr method paired to __vfs_getxattr 2019-11-05 13:50:57 -08:00
xattr_user.c FROMLIST: Add flags option to get xattr method paired to __vfs_getxattr 2019-11-05 13:50:57 -08:00