All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] [fsck.gfs2 PATCH] fsck.gfs2: Fix journal sequence number reporting problem
       [not found] <1279756722.14337905.1422040128887.JavaMail.zimbra@redhat.com>
@ 2015-01-23 19:10 ` Bob Peterson
  2015-01-26 10:54   ` Andrew Price
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Peterson @ 2015-01-23 19:10 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

This bug was spotted by coverity. The fsck.gfs2 should include a line
to report the number of journal sequence errors fixed. It was coded
improperly so that it was never displayed. This patch fixes the code
so that the message will be printed properly.

Regards,

Bob Peterson
Red Hat File Systems

Signed-off-by: Bob Peterson <rpeterso@redhat.com> 
---
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index abb8187..9be5a95 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -436,10 +436,9 @@ static int check_journal_seq_no(struct gfs2_inode *ip, int fix)
 			  (unsigned long long)lowest_seq,
 			  (unsigned long long)highest_seq,
 			  (unsigned long long)prev_seq);
-		if (!fix) {
-			seq_errors++;
+		seq_errors++;
+		if (!fix)
 			continue;
-		}
 		highest_seq++;
 		lh.lh_sequence = highest_seq;
 		prev_seq = lh.lh_sequence;
@@ -449,8 +448,10 @@ static int check_journal_seq_no(struct gfs2_inode *ip, int fix)
 		gfs2_log_header_out(&lh, bh);
 		brelse(bh);
 	}
-	if (seq_errors && fix)
+	if (seq_errors && fix) {
 		log_err(_("%d sequence errors fixed.\n"), seq_errors);
+		seq_errors = 0;
+	}
 	return seq_errors;
 }
 



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Cluster-devel] [fsck.gfs2 PATCH] fsck.gfs2: Fix journal sequence number reporting problem
  2015-01-23 19:10 ` [Cluster-devel] [fsck.gfs2 PATCH] fsck.gfs2: Fix journal sequence number reporting problem Bob Peterson
@ 2015-01-26 10:54   ` Andrew Price
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Price @ 2015-01-26 10:54 UTC (permalink / raw)
  To: cluster-devel.redhat.com

On 23/01/15 19:10, Bob Peterson wrote:
> Hi,
>
> This bug was spotted by coverity. The fsck.gfs2 should include a line
> to report the number of journal sequence errors fixed. It was coded
> improperly so that it was never displayed. This patch fixes the code
> so that the message will be printed properly.

ACK - thanks for dealing with coverity complaints.

Cheers,
Andy

>
> Regards,
>
> Bob Peterson
> Red Hat File Systems
>
> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
> ---
> diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
> index abb8187..9be5a95 100644
> --- a/gfs2/fsck/fs_recovery.c
> +++ b/gfs2/fsck/fs_recovery.c
> @@ -436,10 +436,9 @@ static int check_journal_seq_no(struct gfs2_inode *ip, int fix)
>   			  (unsigned long long)lowest_seq,
>   			  (unsigned long long)highest_seq,
>   			  (unsigned long long)prev_seq);
> -		if (!fix) {
> -			seq_errors++;
> +		seq_errors++;
> +		if (!fix)
>   			continue;
> -		}
>   		highest_seq++;
>   		lh.lh_sequence = highest_seq;
>   		prev_seq = lh.lh_sequence;
> @@ -449,8 +448,10 @@ static int check_journal_seq_no(struct gfs2_inode *ip, int fix)
>   		gfs2_log_header_out(&lh, bh);
>   		brelse(bh);
>   	}
> -	if (seq_errors && fix)
> +	if (seq_errors && fix) {
>   		log_err(_("%d sequence errors fixed.\n"), seq_errors);
> +		seq_errors = 0;
> +	}
>   	return seq_errors;
>   }
>
>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-26 10:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1279756722.14337905.1422040128887.JavaMail.zimbra@redhat.com>
2015-01-23 19:10 ` [Cluster-devel] [fsck.gfs2 PATCH] fsck.gfs2: Fix journal sequence number reporting problem Bob Peterson
2015-01-26 10:54   ` Andrew Price

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.