diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/xfs_iops.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index f35d5c953ff9..9ddfb8190ca1 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c | |||
@@ -705,7 +705,6 @@ xfs_setattr_size( | |||
705 | { | 705 | { |
706 | struct xfs_mount *mp = ip->i_mount; | 706 | struct xfs_mount *mp = ip->i_mount; |
707 | struct inode *inode = VFS_I(ip); | 707 | struct inode *inode = VFS_I(ip); |
708 | int mask = iattr->ia_valid; | ||
709 | xfs_off_t oldsize, newsize; | 708 | xfs_off_t oldsize, newsize; |
710 | struct xfs_trans *tp; | 709 | struct xfs_trans *tp; |
711 | int error; | 710 | int error; |
@@ -726,8 +725,8 @@ xfs_setattr_size( | |||
726 | 725 | ||
727 | ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); | 726 | ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); |
728 | ASSERT(S_ISREG(ip->i_d.di_mode)); | 727 | ASSERT(S_ISREG(ip->i_d.di_mode)); |
729 | ASSERT((mask & (ATTR_UID|ATTR_GID|ATTR_ATIME|ATTR_ATIME_SET| | 728 | ASSERT((iattr->ia_valid & (ATTR_UID|ATTR_GID|ATTR_ATIME|ATTR_ATIME_SET| |
730 | ATTR_MTIME_SET|ATTR_KILL_PRIV|ATTR_TIMES_SET)) == 0); | 729 | ATTR_MTIME_SET|ATTR_KILL_PRIV|ATTR_TIMES_SET)) == 0); |
731 | 730 | ||
732 | oldsize = inode->i_size; | 731 | oldsize = inode->i_size; |
733 | newsize = iattr->ia_size; | 732 | newsize = iattr->ia_size; |
@@ -736,7 +735,7 @@ xfs_setattr_size( | |||
736 | * Short circuit the truncate case for zero length files. | 735 | * Short circuit the truncate case for zero length files. |
737 | */ | 736 | */ |
738 | if (newsize == 0 && oldsize == 0 && ip->i_d.di_nextents == 0) { | 737 | if (newsize == 0 && oldsize == 0 && ip->i_d.di_nextents == 0) { |
739 | if (!(mask & (ATTR_CTIME|ATTR_MTIME))) | 738 | if (!(iattr->ia_valid & (ATTR_CTIME|ATTR_MTIME))) |
740 | return 0; | 739 | return 0; |
741 | 740 | ||
742 | /* | 741 | /* |
@@ -824,10 +823,11 @@ xfs_setattr_size( | |||
824 | * these flags set. For all other operations the VFS set these flags | 823 | * these flags set. For all other operations the VFS set these flags |
825 | * explicitly if it wants a timestamp update. | 824 | * explicitly if it wants a timestamp update. |
826 | */ | 825 | */ |
827 | if (newsize != oldsize && (!(mask & (ATTR_CTIME | ATTR_MTIME)))) { | 826 | if (newsize != oldsize && |
827 | !(iattr->ia_valid & (ATTR_CTIME | ATTR_MTIME))) { | ||
828 | iattr->ia_ctime = iattr->ia_mtime = | 828 | iattr->ia_ctime = iattr->ia_mtime = |
829 | current_fs_time(inode->i_sb); | 829 | current_fs_time(inode->i_sb); |
830 | mask |= ATTR_CTIME | ATTR_MTIME; | 830 | iattr->ia_valid |= ATTR_CTIME | ATTR_MTIME; |
831 | } | 831 | } |
832 | 832 | ||
833 | /* | 833 | /* |
@@ -863,9 +863,9 @@ xfs_setattr_size( | |||
863 | xfs_inode_clear_eofblocks_tag(ip); | 863 | xfs_inode_clear_eofblocks_tag(ip); |
864 | } | 864 | } |
865 | 865 | ||
866 | if (mask & ATTR_MODE) | 866 | if (iattr->ia_valid & ATTR_MODE) |
867 | xfs_setattr_mode(ip, iattr); | 867 | xfs_setattr_mode(ip, iattr); |
868 | if (mask & (ATTR_ATIME|ATTR_CTIME|ATTR_MTIME)) | 868 | if (iattr->ia_valid & (ATTR_ATIME|ATTR_CTIME|ATTR_MTIME)) |
869 | xfs_setattr_time(ip, iattr); | 869 | xfs_setattr_time(ip, iattr); |
870 | 870 | ||
871 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); | 871 | xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); |