diff mbox series

[28/45] xfs_repair: fix the RT device check in process_dinode_int

Message ID 20250409075557.3535745-29-hch@lst.de (mailing list archive)
State New
Headers show
Series [01/45] xfs: generalize the freespace and reserved blocks handling | expand

Commit Message

Christoph Hellwig April 9, 2025, 7:55 a.m. UTC
Don't look at the variable for the rtname command line option, but
the actual file system geometry.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 repair/dinode.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Darrick J. Wong April 9, 2025, 4:11 p.m. UTC | #1
On Wed, Apr 09, 2025 at 09:55:31AM +0200, Christoph Hellwig wrote:
> Don't look at the variable for the rtname command line option, but
> the actual file system geometry.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  repair/dinode.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/repair/dinode.c b/repair/dinode.c
> index 7bdd3dcf15c1..0c559c408085 100644
> --- a/repair/dinode.c
> +++ b/repair/dinode.c
> @@ -3265,8 +3265,9 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
>  			flags &= XFS_DIFLAG_ANY;
>  		}
>  
> -		/* need an rt-dev for the realtime flag! */
> -		if ((flags & XFS_DIFLAG_REALTIME) && !rt_name) {
> +		/* need an rt-dev for the realtime flag */
> +		if ((flags & XFS_DIFLAG_REALTIME) &&
> +		    !mp->m_rtdev_targp) {

If we're going to check the fs geometry, then why not check
mp->m_sb.sb_rextents != 0?

--D

>  			if (!uncertain) {
>  				do_warn(
>  	_("inode %" PRIu64 " has RT flag set but there is no RT device\n"),
> -- 
> 2.47.2
> 
>
Christoph Hellwig April 10, 2025, 6:29 a.m. UTC | #2
On Wed, Apr 09, 2025 at 09:11:55AM -0700, Darrick J. Wong wrote:
> > index 7bdd3dcf15c1..0c559c408085 100644
> > --- a/repair/dinode.c
> > +++ b/repair/dinode.c
> > @@ -3265,8 +3265,9 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
> >  			flags &= XFS_DIFLAG_ANY;
> >  		}
> >  
> > -		/* need an rt-dev for the realtime flag! */
> > -		if ((flags & XFS_DIFLAG_REALTIME) && !rt_name) {
> > +		/* need an rt-dev for the realtime flag */
> > +		if ((flags & XFS_DIFLAG_REALTIME) &&
> > +		    !mp->m_rtdev_targp) {
> 
> If we're going to check the fs geometry, then why not check
> mp->m_sb.sb_rextents != 0?

I'll give it a spin.
diff mbox series

Patch

diff --git a/repair/dinode.c b/repair/dinode.c
index 7bdd3dcf15c1..0c559c408085 100644
--- a/repair/dinode.c
+++ b/repair/dinode.c
@@ -3265,8 +3265,9 @@  _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
 			flags &= XFS_DIFLAG_ANY;
 		}
 
-		/* need an rt-dev for the realtime flag! */
-		if ((flags & XFS_DIFLAG_REALTIME) && !rt_name) {
+		/* need an rt-dev for the realtime flag */
+		if ((flags & XFS_DIFLAG_REALTIME) &&
+		    !mp->m_rtdev_targp) {
 			if (!uncertain) {
 				do_warn(
 	_("inode %" PRIu64 " has RT flag set but there is no RT device\n"),