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 @@ -1150,6 +1150,14 @@ xfs_ioctl_setattr_xflags(
1150
1150
ip -> i_diflags2 = i_flags2 ;
1151
1151
1152
1152
xfs_diflags_to_iflags (ip , false);
1153
+
1154
+ /*
1155
+ * Make the stable writes flag match that of the device the inode
1156
+ * resides on when flipping the RT flag.
1157
+ */
1158
+ if (rtflag != XFS_IS_REALTIME_INODE (ip ) && S_ISREG (VFS_I (ip )-> i_mode ))
1159
+ xfs_update_stable_writes (ip );
1160
+
1153
1161
xfs_trans_ichgtime (tp , ip , XFS_ICHGTIME_CHG );
1154
1162
xfs_trans_log_inode (tp , ip , XFS_ILOG_CORE );
1155
1163
XFS_STATS_INC (mp , xs_ig_attrchg );
Original file line number Diff line number Diff line change @@ -1298,6 +1298,13 @@ xfs_setup_inode(
1298
1298
gfp_mask = mapping_gfp_mask (inode -> i_mapping );
1299
1299
mapping_set_gfp_mask (inode -> i_mapping , (gfp_mask & ~(__GFP_FS )));
1300
1300
1301
+ /*
1302
+ * For real-time inodes update the stable write flags to that of the RT
1303
+ * device instead of the data device.
1304
+ */
1305
+ if (S_ISREG (inode -> i_mode ) && XFS_IS_REALTIME_INODE (ip ))
1306
+ xfs_update_stable_writes (ip );
1307
+
1301
1308
/*
1302
1309
* If there is no attribute fork no ACL can exist on this inode,
1303
1310
* and it can't have any file capabilities attached to it either.
You can’t perform that action at this time.
0 commit comments