BACKPORT: ANDROID: fs: ext4: disable support for fallocate FALLOC_FL_PUNCH_HOLE
Cherry-pick from the Android kernel as recommended in:
https://android.googlesource.com/platform/bionic/+/\
oreo-mr1-cts-dev/tests/fcntl_test.cpp#281
This change should only be applied for kernel version older than 4.1.
Do not cherrypick to newer or upstream kernels.
BUG=b:80549098
TEST='tryjob nyan_big-full-tryjob' is successful.
Change-Id: I019c2de559db9e4b95860ab852211b456d78c4ca
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
(cherry picked from commit bdba352e898cbf57c8620ad68c8abf749c784d1f)
Signed-off-by: Kazuhiro Inaba <kinaba@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1187504
Commit-Ready: Sarthak Kukreti <sarthakkukreti@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index ecaa1814..193c508 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3626,6 +3626,7 @@
int ext4_punch_hole(struct file *file, loff_t offset, loff_t length)
{
+#if 0
struct inode *inode = file_inode(file);
struct super_block *sb = inode->i_sb;
ext4_lblk_t first_block, stop_block;
@@ -3811,6 +3812,12 @@
out_mutex:
mutex_unlock(&inode->i_mutex);
return ret;
+#else
+ /*
+ * Disabled as per b/28760453
+ */
+ return -EOPNOTSUPP;
+#endif
}
/*