Skip to contentSkip to conversation

xfsprogs: write both features2 fields when xfs_admin changes lazy_count

PATCH In review Eric Sandeen 2 participants 2 messages Apr 29, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfsprogs: write both features2 fields when xfs_admin changes lazy_count

xfs_admin -c invokes repair directly to change lazy_count, but it doesn't write both features2 fields, so this:

# mkfs.xfs -dfile,name=fsfile,size=10g -llazy-count=0
# xfs_admin -c 1 fsfile
# xfs_repair fsfile

yields errors.

---

repair/phase1.c +2 -0
index 618796e..dbfbc9b 100644
@@ -117,11 +117,13 @@ phase1(xfs_mount_t *mp)
 		if (lazy_count && !xfs_sb_version_haslazysbcount(sb)) {
 			sb->sb_versionnum |= XFS_SB_VERSION_MOREBITSBIT;
 			sb->sb_features2 |= XFS_SB_VERSION2_LAZYSBCOUNTBIT;
+			sb->sb_bad_features2 |= XFS_SB_VERSION2_LAZYSBCOUNTBIT;
 			primary_sb_modified = 1;
 			printf(_("Enabling lazy-counters\n"));
 		} else
 		if (!lazy_count && xfs_sb_version_haslazysbcount(sb)) {
 			sb->sb_features2 &= ~XFS_SB_VERSION2_LAZYSBCOUNTBIT;
+			sb->sb_bad_features2 &= ~XFS_SB_VERSION2_LAZYSBCOUNTBIT;
 			printf(_("Disabling lazy-counters\n"));
 			primary_sb_modified = 1;
 		} else {

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Eric Sandeen

xfs_admin -c invokes repair directly to change lazy_count, but it doesn't write both features2 fields, so this:

# mkfs.xfs -dfile,name=fsfile,size=10g -llazy-count=0
# xfs_admin -c 1 fsfile
# xfs_repair fsfile

yields errors.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs