All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH V5] xfs_db: add crc manipulation commands
Date: Mon, 22 Aug 2016 10:38:00 +1000	[thread overview]
Message-ID: <20160822003800.GN19025@dastard> (raw)
In-Reply-To: <0bb88897-3dfc-de4e-05fb-b737221f0d80@sandeen.net>

On Sun, Aug 14, 2016 at 07:30:51PM -0500, Eric Sandeen wrote:
> This adds a new "crc" command to xfs_db for CRC-enabled filesystems.
....
> diff --git a/db/io.c b/db/io.c
> index 91cab12..240b129 100644
> --- a/db/io.c
> +++ b/db/io.c
> @@ -27,6 +27,7 @@
>  #include "output.h"
>  #include "init.h"
>  #include "malloc.h"
> +#include "crc.h"
>  
>  static int	pop_f(int argc, char **argv);
>  static void     pop_help(void);
> @@ -473,12 +474,15 @@ xfs_verify_recalc_crc(
>  void
>  write_cur(void)
>  {
> +	int skip_crc = (iocur_top->bp->b_ops->verify_write == xfs_dummy_verify);
> +
>  	if (iocur_sp < 0) {
>  		dbprintf(_("nothing to write\n"));
>  		return;
>  	}
>  
> -	if (xfs_sb_version_hascrc(&mp->m_sb) && iocur_top->ino_buf) {
> +	if (xfs_sb_version_hascrc(&mp->m_sb) && iocur_top->ino_buf &&
> +	    !skip_crc) {
>  		libxfs_dinode_calc_crc(mp, iocur_top->data);
>  		iocur_top->ino_crc_ok = 1;
>  	}
> @@ -489,6 +493,19 @@ write_cur(void)
>  		write_cur_bbs();
>  	else
>  		write_cur_buf();
> +
> +	/* If we didn't write the crc automatically, re-check validity */
> +	if (iocur_top->ino_buf && skip_crc) {
> +		xfs_dinode_t	*dip;
> +		xfs_ino_t	ino;
> +
> +		dip = iocur_top->data;
> +		ino = iocur_top->ino;
> +		iocur_top->ino_crc_ok = xfs_verify_cksum((char *)dip,
> +						mp->m_sb.sb_inodesize,
> +						XFS_DINODE_CRC_OFF);
> +	}
> +

io.c: In function ¿write_cur¿:
io.c:500:13: warning: variable ¿ino¿ set but not used [-Wunused-but-set-variable]
   xfs_ino_t ino;

I've just removed the unused xfs_ino_t here, because it doesn't seem
to have any purpose here.


> diff --git a/db/write.h b/db/write.h
> index 31e2665..664ddcc 100644
> --- a/db/write.h
> +++ b/db/write.h
> @@ -20,5 +20,5 @@ struct field;
>  
>  extern void	write_init(void);
>  extern void	write_block(const field_t *fields, int argc, char **argv);
> -extern void	write_string(const field_t *fields, int argc, char **argv);
>  extern void	write_struct(const field_t *fields, int argc, char **argv);
> +extern void	write_string(const field_t *fields, int argc, char **argv);

Stray hunk? (removed)

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2016-08-22  0:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-12 23:30 [PATCH V4] xfs_db: add crc manipulation commands Eric Sandeen
2016-08-14  3:15 ` Zorro Lang
2016-08-14 15:40   ` Eric Sandeen
2016-08-15  0:30 ` [PATCH V5] " Eric Sandeen
2016-08-22  0:38   ` Dave Chinner [this message]
2016-08-22  0:45     ` Eric Sandeen
2016-08-22  0:54   ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160822003800.GN19025@dastard \
    --to=david@fromorbit.com \
    --cc=sandeen@sandeen.net \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.