diff mbox series

[2/4] libxfs: don't propagate RTINHERIT -> REALTIME when there is no rtdev

Message ID 160013467762.2932378.12947505930529559840.stgit@magnolia (mailing list archive)
State Accepted
Headers show
Series xfsprogs: even more fixes for 5.9 | expand

Commit Message

Darrick J. Wong Sept. 15, 2020, 1:51 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

When creating a file inside a directory that has RTINHERIT set, only
propagate the REALTIME flag to the file if the filesystem actually has a
realtime volume configured.  Otherwise, we end up writing inodes that
trip the verifiers.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 libxfs/util.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Christoph Hellwig Sept. 17, 2020, 8:02 a.m. UTC | #1
On Mon, Sep 14, 2020 at 06:51:17PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> When creating a file inside a directory that has RTINHERIT set, only
> propagate the REALTIME flag to the file if the filesystem actually has a
> realtime volume configured.  Otherwise, we end up writing inodes that
> trip the verifiers.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
Eric Sandeen Sept. 28, 2020, 9:26 p.m. UTC | #2
On 9/14/20 8:51 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> When creating a file inside a directory that has RTINHERIT set, only
> propagate the REALTIME flag to the file if the filesystem actually has a
> realtime volume configured.  Otherwise, we end up writing inodes that
> trip the verifiers.

The "else" means this is only for non-directories; we still propagate
the inherit flag to dirs even without an RT subdir, because ....  *shrug*
kernel lets you set it explicitly, and repair (now) doesn't care either?

Ok, seems reasonable.

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

-Eric

> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  libxfs/util.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 
> diff --git a/libxfs/util.c b/libxfs/util.c
> index 78519872e8e8..f1b4759728ec 100644
> --- a/libxfs/util.c
> +++ b/libxfs/util.c
> @@ -224,9 +224,9 @@ xfs_inode_propagate_flags(
>  			ip->i_d.di_extsize = pip->i_d.di_extsize;
>  		}
>  	} else {
> -		if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) {
> +		if ((pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) &&
> +		    xfs_sb_version_hasrealtime(&ip->i_mount->m_sb))
>  			di_flags |= XFS_DIFLAG_REALTIME;
> -		}
>  		if (pip->i_d.di_flags & XFS_DIFLAG_EXTSZINHERIT) {
>  			di_flags |= XFS_DIFLAG_EXTSIZE;
>  			ip->i_d.di_extsize = pip->i_d.di_extsize;
>
diff mbox series

Patch

diff --git a/libxfs/util.c b/libxfs/util.c
index 78519872e8e8..f1b4759728ec 100644
--- a/libxfs/util.c
+++ b/libxfs/util.c
@@ -224,9 +224,9 @@  xfs_inode_propagate_flags(
 			ip->i_d.di_extsize = pip->i_d.di_extsize;
 		}
 	} else {
-		if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) {
+		if ((pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) &&
+		    xfs_sb_version_hasrealtime(&ip->i_mount->m_sb))
 			di_flags |= XFS_DIFLAG_REALTIME;
-		}
 		if (pip->i_d.di_flags & XFS_DIFLAG_EXTSZINHERIT) {
 			di_flags |= XFS_DIFLAG_EXTSIZE;
 			ip->i_d.di_extsize = pip->i_d.di_extsize;