xfs: respect the stable writes flag on the RT device
[platform/kernel/linux-starfive.git] / fs / xfs / xfs_iops.c
index 1c1e617..b8ec045 100644 (file)
@@ -584,6 +584,11 @@ xfs_vn_getattr(
                }
        }
 
+       if ((request_mask & STATX_CHANGE_COOKIE) && IS_I_VERSION(inode)) {
+               stat->change_cookie = inode_query_iversion(inode);
+               stat->result_mask |= STATX_CHANGE_COOKIE;
+       }
+
        /*
         * Note: If you add another clause to set an attribute flag, please
         * update attributes_mask below.
@@ -1294,6 +1299,13 @@ xfs_setup_inode(
        mapping_set_gfp_mask(inode->i_mapping, (gfp_mask & ~(__GFP_FS)));
 
        /*
+        * For real-time inodes update the stable write flags to that of the RT
+        * device instead of the data device.
+        */
+       if (S_ISREG(inode->i_mode) && XFS_IS_REALTIME_INODE(ip))
+               xfs_update_stable_writes(ip);
+
+       /*
         * If there is no attribute fork no ACL can exist on this inode,
         * and it can't have any file capabilities attached to it either.
         */