File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -569,6 +569,14 @@ extern void xfs_setup_inode(struct xfs_inode *ip);
569
569
extern void xfs_setup_iops (struct xfs_inode * ip );
570
570
extern void xfs_diflags_to_iflags (struct xfs_inode * ip , bool init );
571
571
572
+ static inline void xfs_update_stable_writes (struct xfs_inode * ip )
573
+ {
574
+ if (bdev_stable_writes (xfs_inode_buftarg (ip )-> bt_bdev ))
575
+ mapping_set_stable_writes (VFS_I (ip )-> i_mapping );
576
+ else
577
+ mapping_clear_stable_writes (VFS_I (ip )-> i_mapping );
578
+ }
579
+
572
580
/*
573
581
* When setting up a newly allocated inode, we need to call
574
582
* xfs_finish_inode_setup() once the inode is fully instantiated at
Original file line number Diff line number Diff line change @@ -1153,6 +1153,14 @@ xfs_ioctl_setattr_xflags(
1153
1153
ip -> i_diflags2 = i_flags2 ;
1154
1154
1155
1155
xfs_diflags_to_iflags (ip , false);
1156
+
1157
+ /*
1158
+ * Make the stable writes flag match that of the device the inode
1159
+ * resides on when flipping the RT flag.
1160
+ */
1161
+ if (rtflag != XFS_IS_REALTIME_INODE (ip ) && S_ISREG (VFS_I (ip )-> i_mode ))
1162
+ xfs_update_stable_writes (ip );
1163
+
1156
1164
xfs_trans_ichgtime (tp , ip , XFS_ICHGTIME_CHG );
1157
1165
xfs_trans_log_inode (tp , ip , XFS_ILOG_CORE );
1158
1166
XFS_STATS_INC (mp , xs_ig_attrchg );
Original file line number Diff line number Diff line change @@ -1291,6 +1291,13 @@ xfs_setup_inode(
1291
1291
gfp_mask = mapping_gfp_mask (inode -> i_mapping );
1292
1292
mapping_set_gfp_mask (inode -> i_mapping , (gfp_mask & ~(__GFP_FS )));
1293
1293
1294
+ /*
1295
+ * For real-time inodes update the stable write flags to that of the RT
1296
+ * device instead of the data device.
1297
+ */
1298
+ if (S_ISREG (inode -> i_mode ) && XFS_IS_REALTIME_INODE (ip ))
1299
+ xfs_update_stable_writes (ip );
1300
+
1294
1301
/*
1295
1302
* If there is no attribute fork no ACL can exist on this inode,
1296
1303
* and it can't have any file capabilities attached to it either.
You can’t perform that action at this time.
0 commit comments