[PATCH v2 4/5] btrfs: fallback to buffered io for verity files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: linux-btrfs@xxxxxxxxxxxxxxx, kernel-team@xxxxxx, linux-fscrypt@xxxxxxxxxxxxxxx, "'Eric Biggers '" <ebiggers@xxxxxxxxxx>
- Subject: [PATCH v2 4/5] btrfs: fallback to buffered io for verity files
- From: Boris Burkov <boris@xxxxxx>
- Date: Fri, 5 Mar 2021 11:26:32 -0800
- In-reply-to: <cover.1614971203.git.boris@bur.io>
- References: <cover.1614971203.git.boris@bur.io>
Reading the contents with direct IO would circumvent verity checks, so
fallback to buffered reads. For what it's worth, this is how ext4
handles it as well.
Signed-off-by: Boris Burkov <boris@xxxxxx>
---
fs/btrfs/file.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 75f1406021e5..c948c30e132c 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -3623,6 +3623,9 @@ static ssize_t btrfs_direct_read(struct kiocb *iocb, struct iov_iter *to)
struct inode *inode = file_inode(iocb->ki_filp);
ssize_t ret;
+ if (fsverity_active(inode))
+ return 0;
+
if (check_direct_read(btrfs_sb(inode->i_sb), to, iocb->ki_pos))
return 0;
--
2.24.1
[Index of Archives]
[linux Cryptography]
[Asterisk App Development]
[PJ SIP]
[Gnu Gatekeeper]
[IETF Sipping]
[Info Cyrus]
[ALSA User]
[Fedora Linux Users]
[Linux SCTP]
[DCCP]
[Gimp]
[Yosemite News]
[Deep Creek Hot Springs]
[Yosemite Campsites]
[ISDN Cause Codes]