linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Stefan Ring <stefanrin@gmail.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 5/5] xfs_metadump: Zap dev inodes
Date: Thu, 3 Jan 2019 09:57:09 -0800	[thread overview]
Message-ID: <20190103175709.GE20475@magnolia> (raw)
In-Reply-To: <20181105213145.7560-6-stefanrin@gmail.com>

On Mon, Nov 05, 2018 at 10:31:45PM +0100, Stefan Ring wrote:
> Signed-off-by: Stefan Ring <stefanrin@gmail.com>
> ---
>  db/metadump.c | 29 ++++++++++++++++++++++++++++-
>  1 file changed, 28 insertions(+), 1 deletion(-)
> 
> diff --git a/db/metadump.c b/db/metadump.c
> index 59765263..57d6bc09 100644
> --- a/db/metadump.c
> +++ b/db/metadump.c
> @@ -2269,6 +2269,25 @@ process_inode_data(
>  	return 1;
>  }
>  
> +static int
> +process_dev_inode(
> +	xfs_dinode_t		*dip)
> +{
> +	if (XFS_DFORK_NEXTENTS(dip, XFS_DATA_FORK)) {
> +		if (show_warnings)
> +			print_warning("inode %llu has unexpected extents",
> +				      (unsigned long long)cur_ino);
> +		return 0;
> +	} else {
> +		if (zero_stale_data) {
> +			unsigned int	size = sizeof(xfs_dev_t);
> +			memset(XFS_DFORK_DPTR(dip) + size, 0,

Blank line needed between the  variable definition and the first line of
code.  Otherwise looks fine to me...

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> +					XFS_DFORK_DSIZE(dip, mp) - size);
> +		}
> +		return 1;
> +	}
> +}
> +
>  /*
>   * when we process the inode, we may change the data in the data and/or
>   * attribute fork if they are in short form and we are obfuscating names.
> @@ -2321,7 +2340,15 @@ process_inode(
>  		case S_IFREG:
>  			success = process_inode_data(dip, TYP_DATA);
>  			break;
> -		default: ;
> +		case S_IFIFO:
> +		case S_IFCHR:
> +		case S_IFBLK:
> +		case S_IFSOCK:
> +			success = process_dev_inode(dip);
> +			need_new_crc = 1;
> +			break;
> +		default:
> +			break;
>  	}
>  	nametable_clear();
>  
> -- 
> 2.14.5
> 

  reply	other threads:[~2019-01-03 17:57 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-05 21:31 [PATCH v5 0/5] Try to squash metadump data leaks Stefan Ring
2018-11-05 21:31 ` [PATCH 1/5] xfs_metadump: Extend data zapping to XFS_DIR{2,3}_LEAFN_MAGIC blocks Stefan Ring
2018-12-20 22:20   ` Eric Sandeen
2018-11-05 21:31 ` [PATCH 2/5] xfs_metadump: Zap multi fsb blocks Stefan Ring
2019-01-03 17:55   ` Darrick J. Wong
2019-01-04 22:27     ` Stefan Ring
2019-01-04 23:11       ` Eric Sandeen
2018-11-05 21:31 ` [PATCH 3/5] xfs_metadump: Zap freeindex blocks in directory inodes Stefan Ring
2019-01-03 17:59   ` Darrick J. Wong
2018-11-05 21:31 ` [PATCH 4/5] xfs_metadump: Zap unused space in inode btrees Stefan Ring
2019-01-03 17:57   ` Darrick J. Wong
2018-11-05 21:31 ` [PATCH 5/5] xfs_metadump: Zap dev inodes Stefan Ring
2019-01-03 17:57   ` Darrick J. Wong [this message]
2018-12-06 17:04 ` [PATCH v5 0/5] Try to squash metadump data leaks Stefan Ring
2018-12-06 20:23   ` Eric Sandeen
2019-01-07 20:13 ` [PATCH v6 " Stefan Ring
2019-01-07 20:13   ` [PATCH 1/5] xfs_metadump: Extend data zapping to XFS_DIR{2,3}_LEAFN_MAGIC blocks Stefan Ring
2019-01-07 20:13   ` [PATCH 2/5] xfs_metadump: Zap multi fsb blocks Stefan Ring
2019-01-11 17:31     ` Eric Sandeen
2019-01-14 17:42       ` Stefan Ring
2019-01-14 17:46         ` Eric Sandeen
2019-01-07 20:13   ` [PATCH 3/5] xfs_metadump: Zap freeindex blocks in directory inodes Stefan Ring
2019-01-07 20:13   ` [PATCH 4/5] xfs_metadump: Zap unused space in inode btrees Stefan Ring
2019-01-07 20:13   ` [PATCH 5/5] xfs_metadump: Zap dev inodes Stefan Ring
  -- strict thread matches above, loose matches on Subject: below --
2018-10-26 20:19 [PATCH 0/5] v4 Try to squash metadump data leaks Stefan Ring
2018-10-26 20:19 ` [PATCH 5/5] xfs_metadump: Zap dev inodes Stefan Ring
2018-10-29 15:38   ` Eric Sandeen
2018-10-29 18:33     ` Stefan Ring
2018-10-29 18:37       ` Eric Sandeen
2018-10-29 18:45         ` Stefan Ring

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=20190103175709.GE20475@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=stefanrin@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).