android_kernel_motorola_sm6375/include
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
..
acpi x86: ACPI: fix CPU hotplug deadlock 2020-04-23 10:36:38 +02:00
asm-generic This is the 5.4.35 stable release 2020-04-23 11:15:10 +02:00
clocksource
crypto
drm This is the 5.4.40 stable release 2020-05-11 09:59:15 +02:00
dt-bindings clk: imx8mn: Fix incorrect clock defines 2020-03-18 07:17:55 +01:00
keys KEYS: Don't write out to userspace while holding key semaphore 2020-04-23 10:36:45 +02:00
kvm
linux ANDROID: fscrypt: handle direct I/O with IV_INO_LBLK_32 2020-05-21 11:52:18 -07:00
math-emu
media This is the 5.4.33 stable release 2020-04-17 11:26:58 +02:00
misc
net This is the 5.4.42 stable release 2020-05-20 12:49:59 +02:00
pcmcia
ras
rdma FROMLIST: BACKPORT: dynamic_debug: Add an option to enable dynamic debug for modules only 2020-04-22 21:34:15 +00:00
scsi ANDROID: GKI: scsi: add Android ABI padding to some structures 2020-04-23 19:26:27 +02:00
soc
sound This is the 5.4.42 stable release 2020-05-20 12:49:59 +02:00
target scsi: target: fix hang when multiple threads try to destroy the same iscsi session 2020-04-21 09:05:04 +02:00
trace This is the 5.4.37 stable release 2020-05-02 09:01:51 +02:00
uapi BACKPORT: FROMLIST: fscrypt: add support for IV_INO_LBLK_32 policies 2020-05-21 11:40:32 -07:00
vdso UPSTREAM: vdso: Fix clocksource.h macro detection 2020-05-03 18:56:52 +00:00
video
xen