From 6c15769f8e5eff7288612936c169ed002a23bf5c Mon Sep 17 00:00:00 2001 From: "Mr. Ubuntu" Date: Thu, 12 May 2022 17:54:12 -0400 Subject: [PATCH] Added new BMAP methods for 5.6(new_bmap.patch) and 5.2(old_bmap.patch) --- bug-fixes/new_bmap.patch | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 bug-fixes/new_bmap.patch diff --git a/bug-fixes/new_bmap.patch b/bug-fixes/new_bmap.patch new file mode 100644 index 0000000..f054320 --- /dev/null +++ b/bug-fixes/new_bmap.patch @@ -0,0 +1,24 @@ +diff --git a/fs/wrapfs/mmap.c b/fs/wrapfs/mmap.c +index 9897fa585b97..3eea96f41deb 100644 +--- a/fs/wrapfs/mmap.c ++++ b/fs/wrapfs/mmap.c +@@ -84,8 +84,19 @@ static ssize_t wrapfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter) + return -EINVAL; + } + ++static sector_t wrapfs_bmap(struct address_space *mapping, sector_t block) ++{ ++ struct inode *lower_inode = wrapfs_lower_inode(mapping->host); ++ int ret = bmap(lower_inode, &block); ++ ++ if (ret) ++ return 0; ++ return block; ++} ++ + const struct address_space_operations wrapfs_aops = { + .direct_IO = wrapfs_direct_IO, ++ .bmap = wrapfs_bmap, + }; + + const struct vm_operations_struct wrapfs_vm_ops = { -- 2.43.0