Message ID | 20200412064443.dAbp2Cd46%akpm@linux-foundation.org |
---|---|
State | New |
Headers | show |
Series | [merged] ocfs2-no-need-try-to-truncate-file-beyond-i_size.patch removed from -mm tree | expand |
--- a/fs/ocfs2/alloc.c~ocfs2-no-need-try-to-truncate-file-beyond-i_size +++ a/fs/ocfs2/alloc.c @@ -7402,6 +7402,10 @@ int ocfs2_truncate_inline(struct inode * struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data; struct ocfs2_inline_data *idata = &di->id2.i_data; + /* No need to punch hole beyond i_size. */ + if (start >= i_size_read(inode)) + return 0; + if (end > i_size_read(inode)) end = i_size_read(inode);