|
@@ -477,11 +477,6 @@ static int ocfs2_truncate_file(struct inode *inode,
|
|
|
goto bail;
|
|
|
}
|
|
|
|
|
|
- /* lets handle the simple truncate cases before doing any more
|
|
|
- * cluster locking. */
|
|
|
- if (new_i_size == le64_to_cpu(fe->i_size))
|
|
|
- goto bail;
|
|
|
-
|
|
|
down_write(&OCFS2_I(inode)->ip_alloc_sem);
|
|
|
|
|
|
ocfs2_resv_discard(&osb->osb_la_resmap,
|
|
@@ -1148,14 +1143,14 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
|
|
|
goto bail_unlock_rw;
|
|
|
}
|
|
|
|
|
|
- if (size_change && attr->ia_size != i_size_read(inode)) {
|
|
|
+ if (size_change) {
|
|
|
status = inode_newsize_ok(inode, attr->ia_size);
|
|
|
if (status)
|
|
|
goto bail_unlock;
|
|
|
|
|
|
inode_dio_wait(inode);
|
|
|
|
|
|
- if (i_size_read(inode) > attr->ia_size) {
|
|
|
+ if (i_size_read(inode) >= attr->ia_size) {
|
|
|
if (ocfs2_should_order_data(inode)) {
|
|
|
status = ocfs2_begin_ordered_truncate(inode,
|
|
|
attr->ia_size);
|