[v3,4/5] xfs_repair: zero shared_vn
diff mbox

Message ID 20170121000925.GJ12985@birch.djwong.org
State Accepted
Headers show

Commit Message

Darrick J. Wong Jan. 21, 2017, 12:09 a.m. UTC
Since shared_vn always has to be zero, zero it at the start of repair.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
v2: reset shared_vn in phase 1 and tell the user about it, per sandeen
v3: more suggestions by sandeen to make the new code more consistent
---
 repair/phase1.c |    7 +++++++
 1 file changed, 7 insertions(+)

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Eric Sandeen Jan. 24, 2017, 2:38 a.m. UTC | #1
On 1/20/17 6:09 PM, Darrick J. Wong wrote:
> Since shared_vn always has to be zero, zero it at the start of repair.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

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

> ---
> v2: reset shared_vn in phase 1 and tell the user about it, per sandeen
> v3: more suggestions by sandeen to make the new code more consistent
> ---
>  repair/phase1.c |    7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/repair/phase1.c b/repair/phase1.c
> index 126d0b3..9799883 100644
> --- a/repair/phase1.c
> +++ b/repair/phase1.c
> @@ -138,6 +138,13 @@ _("Cannot disable lazy-counters on V5 fs\n"));
>  		}
>  	}
>  
> +	/* shared_vn should be zero */
> +	if (sb->sb_shared_vn) {
> +		do_warn(_("resetting shared_vn to zero\n"));
> +		sb->sb_shared_vn = 0;
> +		primary_sb_modified = 1;
> +	}
> +
>  	if (primary_sb_modified)  {
>  		if (!no_modify)  {
>  			do_warn(_("writing modified primary superblock\n"));
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/repair/phase1.c b/repair/phase1.c
index 126d0b3..9799883 100644
--- a/repair/phase1.c
+++ b/repair/phase1.c
@@ -138,6 +138,13 @@  _("Cannot disable lazy-counters on V5 fs\n"));
 		}
 	}
 
+	/* shared_vn should be zero */
+	if (sb->sb_shared_vn) {
+		do_warn(_("resetting shared_vn to zero\n"));
+		sb->sb_shared_vn = 0;
+		primary_sb_modified = 1;
+	}
+
 	if (primary_sb_modified)  {
 		if (!no_modify)  {
 			do_warn(_("writing modified primary superblock\n"));