[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 11 Nov 2020 14:13:40 +0100
From: Pavel Machek <pavel@....cz>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Nikolay Borisov <nborisov@...e.com>,
Johannes Thumshirn <jthumshirn@...e.de>,
Qu Wenruo <wqu@...e.com>, David Sterba <dsterba@...e.com>,
Ben Hutchings <ben.hutchings@...ethink.co.uk>
Subject: Re: [PATCH 4.19 29/71] btrfs: tree-checker: Verify inode item
Hi!
> From: Qu Wenruo <wqu@...e.com>
>
> commit 496245cac57e26d8b738d85c7a29cf9a47610f3f upstream.
>
> There is a report in kernel bugzilla about mismatch file type in dir
> item and inode item.
>
> This inspires us to check inode mode in inode item.
>
> This patch will check the following members:
> + /* Here we use super block generation + 1 to handle log tree */
> + if (btrfs_inode_generation(leaf, iitem) > super_gen + 1) {
> + inode_item_err(fs_info, leaf, slot,
> + "invalid inode generation: has %llu expect (0, %llu]",
> + btrfs_inode_generation(leaf, iitem),
> + super_gen + 1);
> + return -EUCLEAN;
> + }
Printk suggests btrfs_inode_generation() may not be zero, but the
condition does not actually check that. Should that be added?
> + /* Note for ROOT_TREE_DIR_ITEM, mkfs could set its transid 0 */
> + if (btrfs_inode_transid(leaf, iitem) > super_gen + 1) {
> + inode_item_err(fs_info, leaf, slot,
> + "invalid inode generation: has %llu expect [0, %llu]",
> + btrfs_inode_transid(leaf, iitem), super_gen + 1);
> + return -EUCLEAN;
> + }
Best regards,
Pavel
--
http://www.livejournal.com/~pavelmachek
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists