diff options
Diffstat (limited to 'fs/xfs/xfs_qm_syscalls.c')
| -rw-r--r-- | fs/xfs/xfs_qm_syscalls.c | 12 | 
1 files changed, 9 insertions, 3 deletions
| diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c index 5cc3dde1bc9..711a86e39ff 100644 --- a/fs/xfs/xfs_qm_syscalls.c +++ b/fs/xfs/xfs_qm_syscalls.c @@ -31,6 +31,7 @@  #include "xfs_mount.h"  #include "xfs_bmap_btree.h"  #include "xfs_inode.h" +#include "xfs_inode_item.h"  #include "xfs_itable.h"  #include "xfs_bmap.h"  #include "xfs_rtalloc.h" @@ -263,13 +264,18 @@ xfs_qm_scall_trunc_qfile(  	xfs_ilock(ip, XFS_ILOCK_EXCL);  	xfs_trans_ijoin(tp, ip, 0); -	error = xfs_itruncate_data(&tp, ip, 0); +	ip->i_d.di_size = 0; +	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); + +	error = xfs_itruncate_extents(&tp, ip, XFS_DATA_FORK, 0);  	if (error) {  		xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES |  				     XFS_TRANS_ABORT);  		goto out_unlock;  	} +	ASSERT(ip->i_d.di_nextents == 0); +  	xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);  	error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); @@ -807,11 +813,11 @@ xfs_qm_export_dquot(  	     (XFS_IS_OQUOTA_ENFORCED(mp) &&  			(dst->d_flags & (FS_PROJ_QUOTA | FS_GROUP_QUOTA)))) &&  	    dst->d_id != 0) { -		if (((int) dst->d_bcount >= (int) dst->d_blk_softlimit) && +		if (((int) dst->d_bcount > (int) dst->d_blk_softlimit) &&  		    (dst->d_blk_softlimit > 0)) {  			ASSERT(dst->d_btimer != 0);  		} -		if (((int) dst->d_icount >= (int) dst->d_ino_softlimit) && +		if (((int) dst->d_icount > (int) dst->d_ino_softlimit) &&  		    (dst->d_ino_softlimit > 0)) {  			ASSERT(dst->d_itimer != 0);  		} | 
