diff mbox series

[4/4] xfs_repair: don't flag RTINHERIT files when no rt volume

Message ID 160013469008.2932378.8829835167711862408.stgit@magnolia
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>

Don't flag directories with the RTINHERIT flag set when the filesystem
doesn't have a realtime volume configured.  The kernel has let us set
RTINHERIT without a rt volume for ages, so it's not an invalid state.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 repair/dinode.c |   15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

Comments

Christoph Hellwig Sept. 17, 2020, 8:02 a.m. UTC | #1
On Mon, Sep 14, 2020 at 06:51:30PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Don't flag directories with the RTINHERIT flag set when the filesystem
> doesn't have a realtime volume configured.  The kernel has let us set
> RTINHERIT without a rt volume for ages, so it's not an invalid state.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/repair/dinode.c b/repair/dinode.c
index 48b75f7883c5..8aee9f9e8343 100644
--- a/repair/dinode.c
+++ b/repair/dinode.c
@@ -2393,17 +2393,14 @@  _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
 			flags &= XFS_DIFLAG_ANY;
 		}
 
-		if (flags & (XFS_DIFLAG_REALTIME | XFS_DIFLAG_RTINHERIT)) {
-			/* need an rt-dev! */
-			if (!rt_name) {
-				if (!uncertain) {
-					do_warn(
+		/* need an rt-dev for the realtime flag! */
+		if ((flags & XFS_DIFLAG_REALTIME) && !rt_name) {
+			if (!uncertain) {
+				do_warn(
 	_("inode %" PRIu64 " has RT flag set but there is no RT device\n"),
-						lino);
-				}
-				flags &= ~(XFS_DIFLAG_REALTIME |
-						XFS_DIFLAG_RTINHERIT);
+					lino);
 			}
+			flags &= ~XFS_DIFLAG_REALTIME;
 		}
 		if (flags & XFS_DIFLAG_NEWRTBM) {
 			/* must be a rt bitmap inode */