|
@@ -658,6 +658,13 @@ static int punch_hole(struct inode *inode, loff_t offset, loff_t len)
|
|
loff_t off_start, off_end;
|
|
loff_t off_start, off_end;
|
|
int ret = 0;
|
|
int ret = 0;
|
|
|
|
|
|
|
|
+ if (!S_ISREG(inode->i_mode))
|
|
|
|
+ return -EOPNOTSUPP;
|
|
|
|
+
|
|
|
|
+ /* skip punching hole beyond i_size */
|
|
|
|
+ if (offset >= inode->i_size)
|
|
|
|
+ return ret;
|
|
|
|
+
|
|
ret = f2fs_convert_inline_data(inode, MAX_INLINE_DATA + 1, NULL);
|
|
ret = f2fs_convert_inline_data(inode, MAX_INLINE_DATA + 1, NULL);
|
|
if (ret)
|
|
if (ret)
|
|
return ret;
|
|
return ret;
|