diff mbox

[3/4] btrfs-progs: fix show super unknown flag output

Message ID 1413414861-28097-4-git-send-email-zab@zabbo.net (mailing list archive)
State Accepted
Headers show

Commit Message

Zach Brown Oct. 15, 2014, 11:14 p.m. UTC
coverity pointed out that unknown flag printing in show super had some
dead code.  It turns out that first was reset when the first flag was
tested, not when it was output.  We only want to clear it if the first
matching bit is output.  If there are no matching bits then we'll want
to output the unknown flag first.

Signed-off-by: Zach Brown <zab@zabbo.net>
---
 btrfs-show-super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/btrfs-show-super.c b/btrfs-show-super.c
index 456dbd8..2b48f44 100644
--- a/btrfs-show-super.c
+++ b/btrfs-show-super.c
@@ -324,8 +324,8 @@  static void print_readable_incompat_flag(u64 flag)
 				printf("%s ", entry->output);
 			else
 				printf("|\n\t\t\t  %s ", entry->output);
+			first = 0;
 		}
-		first = 0;
 	}
 	flag &= ~BTRFS_FEATURE_INCOMPAT_SUPP;
 	if (flag) {