aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/extents.c
diff options
context:
space:
mode:
authorTao Ma <boyu.mt@taobao.com>2012-12-10 14:06:03 -0500
committerTheodore Ts'o <tytso@mit.edu>2012-12-10 14:06:03 -0500
commit0c8d414f163f5d35e43a4de7a6e5ee8c253fcccf (patch)
tree7db57d3b2926408bda5bad880896ee4ec384f398 /fs/ext4/extents.c
parentaef1c8513c1f8ae076e22ea2a57eff5835578e75 (diff)
ext4: let fallocate handle inline data correctly
If we are punching hole in a file, we will return ENOTSUPP. As for the fallocation of some extents, we will convert the inline data to a normal extent based file first. Signed-off-by: Tao Ma <boyu.mt@taobao.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r--fs/ext4/extents.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 70dc6fc53a00..d45ff3faefc6 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4399,6 +4399,10 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
4399 if (mode & FALLOC_FL_PUNCH_HOLE) 4399 if (mode & FALLOC_FL_PUNCH_HOLE)
4400 return ext4_punch_hole(file, offset, len); 4400 return ext4_punch_hole(file, offset, len);
4401 4401
4402 ret = ext4_convert_inline_data(inode);
4403 if (ret)
4404 return ret;
4405
4402 trace_ext4_fallocate_enter(inode, offset, len, mode); 4406 trace_ext4_fallocate_enter(inode, offset, len, mode);
4403 map.m_lblk = offset >> blkbits; 4407 map.m_lblk = offset >> blkbits;
4404 /* 4408 /*