linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Lakshmipathi.G" <lakshmipathi.g@giis.co.in>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: misc-tests: Primary Superblock corruption and recovery using backup Superblock.
Date: Wed, 15 Feb 2017 14:44:05 +0530	[thread overview]
Message-ID: <20170215091405.GA11896@giis.co.in> (raw)
In-Reply-To: <da0d119a-68eb-a8ed-5cd4-81202da17e8f@cn.fujitsu.com>

On Wed, Feb 15, 2017 at 09:36:03AM +0800, Qu Wenruo wrote:
> 
> 
> >+	# Corrupt superblock checksum
> >+        dd if=/dev/zero of=$TEST_DEV seek=$superblock_offset bs=1 \
> >+        count=4  conv=notrunc &> /dev/null
> >+	run_check_stdout $SUDO_HELPER mount $TEST_DEV $TEST_MNT | \
> >+	grep -q 'wrong fs type'
> 
> What about using btrfs check instead of trying to mount it?
> 
> This could emit the need to use $SUDO_HELPER, and could catch super error
> more accurate.
> 
> >+        if [ $? -ne 0 ]; then
> >+		_fail "Failed to corrupt superblock."
> >+        fi
> >+
> >+	# Copy backup superblock to primary
> >+	run_check $TOP/btrfs-select-super -s 1 $TEST_DEV
> >+	run_check $SUDO_HELPER mount $TEST_DEV $TEST_MNT
> Same here.
I started with 'btrfs check' and 'btrfs check --repair' but it seems like
--repair don't fix the corruption. So just moved away from using it.

After you mentioned, now I see 'btrfs check' will be helpful. Will make
these changes. 

Cheers.
Lakshmipathi.G

  parent reply	other threads:[~2017-02-15  9:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14 21:31 [PATCH] btrfs-progs: misc-tests: Primary Superblock corruption and recovery using backup Superblock Lakshmipathi.G
     [not found] ` <da0d119a-68eb-a8ed-5cd4-81202da17e8f@cn.fujitsu.com>
2017-02-15  9:14   ` Lakshmipathi.G [this message]
2017-03-13 17:22     ` David Sterba

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=20170215091405.GA11896@giis.co.in \
    --to=lakshmipathi.g@giis.co.in \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo@cn.fujitsu.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).