On Tue, Oct 24, 2023 at 08:09:04AM -0700, Darrick J. Wong wrote: > > + if (S_ISREG(VFS_I(ip)->i_mode) && > > + XFS_IS_REALTIME_INODE(ip) != (fa->fsx_xflags & FS_XFLAG_REALTIME)) > > + xfs_update_stable_writes(ip); > > Hmm. Won't the masking operation here result in the if test comparing 0 > or FS_XFLAG_REALTIME to 0 or 1? > > Oh. FS_XFLAG_REALTIME == 1, so that's not an issue in this one case. > That's a bit subtle though, I'd have preferred > > XFS_IS_REALTIME_INODE(ip) != !!(fa->fsx_xflags & FS_XFLAG_REALTIME)) > > to make it more obvious that the if test isn't comparing apples to > oranges. != !! might be going a bit far. Would you settle for XFS_IS_REALTIME_INODE(ip) == !(fa->fsx_xflags & FS_XFLAG_REALTIME) ? Although none of these read particularly nicely. Maybe XFS_IS_REALTIME_INODE(ip) != ((fa->fsx_xflags & FS_XFLAG_REALTIME) == 0)) Perhaps we need a bool helper for (fa->fsx_xflags & FS_XFLAG_REALTIME)