linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>, WenRuo Qu <wqu@suse.com>,
	linux-btrfs@vger.kernel.org
Cc: Charles Wright <charles.v.wright@gmail.com>
Subject: Re: [PATCH 1/3] btrfs-progs: check/lowmem: Add check and repair for invalid inode generation
Date: Mon, 30 Sep 2019 16:34:31 +0300	[thread overview]
Message-ID: <b7663ce0-d2e8-6da7-bbc7-df0152e56e21@suse.com> (raw)
In-Reply-To: <a73fe243-3be4-9576-6b5e-8b867aa16060@gmx.com>



On 30.09.19 г. 15:24 ч., Qu Wenruo wrote:
> Yes, the ASSERT() doesn't make much sense by itself.
> 
> However I still believe it won't be a problem.

It won't be a problem but it feels wrong to have this assert this deep
into the call chain. IMO It should be put where it can trigger at the
earliest which seems to be in check_inode_item. That function assumes
it's working with an inode item and goes to dereference inode members so
if the type is wrong we'd crash there instead of in repair_inode_gen_lowmem.

> 
> It's compiler's job to remove such dead ASSERT(), but for human reader,
> I still believe this ASSERT() could still make sense, especially when
> the caller or callee can get more and more complex.
> 
> Thanks,

  reply	other threads:[~2019-09-30 13:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-24  8:11 [PATCH 0/3] btrfs-progs: Add check and repair for invalid inode generation Qu Wenruo
2019-09-24  8:11 ` [PATCH 1/3] btrfs-progs: check/lowmem: " Qu Wenruo
2019-09-30 11:36   ` Nikolay Borisov
2019-09-30 12:24     ` Qu Wenruo
2019-09-30 13:34       ` Nikolay Borisov [this message]
2019-09-30 14:05         ` Qu Wenruo
2019-09-24  8:11 ` [PATCH 2/3] btrfs-progs: check/original: " Qu Wenruo
2019-09-30  8:41   ` Nikolay Borisov
2019-09-30  9:00     ` Qu Wenruo
2019-09-24  8:11 ` [PATCH 3/3] btrfs-progs: fsck-tests: Add test image for invalid inode generation repair Qu Wenruo
2019-10-18 20:32 ` [PATCH 0/3] btrfs-progs: Add check and repair for invalid inode generation Ferry Toth
2019-10-18 23:50   ` Qu WenRuo
2019-10-19 16:24     ` Ferry Toth
2019-10-20  0:26       ` Qu Wenruo
2019-10-20  0:51         ` Qu Wenruo
2019-10-20 13:04           ` Ferry Toth
2019-10-20 13:15             ` Qu WenRuo
2019-10-20 13:29               ` Ferry Toth
2019-10-20 14:11                 ` Qu Wenruo
2019-10-20 14:24                   ` Ferry Toth
2019-10-21 16:01                     ` Ferry Toth
2019-10-20 11:50         ` Ferry Toth

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=b7663ce0-d2e8-6da7-bbc7-df0152e56e21@suse.com \
    --to=nborisov@suse.com \
    --cc=charles.v.wright@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=wqu@suse.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).