提交 374e2ac3 编写于 作者: E Eric Sandeen 提交者: Nathan Scott

[XFS] Prevent data corruption on extending truncate case from cxfs client

SGI-PV: 942439
SGI-Modid: xfs-linux:xfs-kern:200152a
Signed-off-by: NEric Sandeen <sandeen@sgi.com>
Signed-off-by: NNathan Scott <nathans@sgi.com>
上级 4750ddb0
......@@ -626,8 +626,10 @@ xfs_setattr(
*/
if (mask & XFS_AT_SIZE) {
code = 0;
if (vap->va_size > ip->i_d.di_size)
if ((vap->va_size > ip->i_d.di_size) &&
(flags & ATTR_NOSIZETOK) == 0) {
code = xfs_igrow_start(ip, vap->va_size, credp);
}
xfs_iunlock(ip, XFS_ILOCK_EXCL);
if (!code)
code = xfs_itruncate_data(ip, vap->va_size);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册