@@ -1444,7 +1444,11 @@ xfs_ioctl_setattr(
* or cancel time, so need to be passed through to
* xfs_ioctl_setattr_get_trans() so it can apply them to the join call
* appropriately.
+ *
+ * Further we hold off aops users until we have completed any potential
+ * changing of aops due to attribute changes.
*/
+ inode_aops_down_write(VFS_I(ip));
code = xfs_ioctl_setattr_dax_invalidate(ip, fa, &join_flags);
if (code)
goto error_free_dquots;
@@ -1527,6 +1531,7 @@ xfs_ioctl_setattr(
xfs_qm_dqrele(udqp);
xfs_qm_dqrele(pdqp);
+ inode_aops_up_write(VFS_I(ip));
return code;
error_trans_cancel:
@@ -1534,6 +1539,7 @@ xfs_ioctl_setattr(
error_free_dquots:
xfs_qm_dqrele(udqp);
xfs_qm_dqrele(pdqp);
+ inode_aops_up_write(VFS_I(ip));
return code;
}
@@ -1603,7 +1609,11 @@ xfs_ioc_setxflags(
* or cancel time, so need to be passed through to
* xfs_ioctl_setattr_get_trans() so it can apply them to the join call
* appropriately.
+ *
+ * Further we hold off aops users until we have completed any potential
+ * changing of aops due to attribute changes.
*/
+ inode_aops_down_write(VFS_I(ip));
error = xfs_ioctl_setattr_dax_invalidate(ip, &fa, &join_flags);
if (error)
goto out_drop_write;
@@ -1630,6 +1640,7 @@ xfs_ioc_setxflags(
error = xfs_trans_commit(tp);
out_drop_write:
mnt_drop_write_file(filp);
+ inode_aops_up_write(VFS_I(ip));
return error;
}