Merge tag 'dmaengine-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul...
[linux-2.6-microblaze.git] / fs / xfs / libxfs / xfs_trans_inode.c
index b7e222b..90f1d56 100644 (file)
@@ -131,6 +131,17 @@ xfs_trans_log_inode(
                        iversion_flags = XFS_ILOG_CORE;
        }
 
+       /*
+        * If we're updating the inode core or the timestamps and it's possible
+        * to upgrade this inode to bigtime format, do so now.
+        */
+       if ((flags & (XFS_ILOG_CORE | XFS_ILOG_TIMESTAMP)) &&
+           xfs_sb_version_hasbigtime(&ip->i_mount->m_sb) &&
+           !xfs_inode_has_bigtime(ip)) {
+               ip->i_d.di_flags2 |= XFS_DIFLAG2_BIGTIME;
+               flags |= XFS_ILOG_CORE;
+       }
+
        /*
         * Record the specific change for fdatasync optimisation. This allows
         * fdatasync to skip log forces for inodes that are only timestamp
@@ -177,9 +188,9 @@ xfs_trans_log_inode(
 
        /*
         * Always OR in the bits from the ili_last_fields field.  This is to
-        * coordinate with the xfs_iflush() and xfs_iflush_done() routines in
-        * the eventual clearing of the ili_fields bits.  See the big comment in
-        * xfs_iflush() for an explanation of this coordination mechanism.
+        * coordinate with the xfs_iflush() and xfs_buf_inode_iodone() routines
+        * in the eventual clearing of the ili_fields bits.  See the big comment
+        * in xfs_iflush() for an explanation of this coordination mechanism.
         */
        iip->ili_fields |= (flags | iip->ili_last_fields | iversion_flags);
        spin_unlock(&iip->ili_lock);