]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: tests: initialize test inodes location
authorJosef Bacik <josef@toxicpanda.com>
Tue, 15 Dec 2020 17:00:26 +0000 (12:00 -0500)
committerDavid Sterba <dsterba@suse.com>
Fri, 18 Dec 2020 13:59:49 +0000 (14:59 +0100)
commit2d73a4e83b2c71cf337d5edca61bf43530bdf95c
tree98bba59f0dfb1840e7ea91e2a49f850dd2f67a15
parentb9fe81f30af341768f31685a8e8e6e81bc46372b
btrfs: tests: initialize test inodes location

I noticed that sometimes the module failed to load because the self
tests failed like this:

  BTRFS: selftest: fs/btrfs/tests/inode-tests.c:963 miscount, wanted 1, got 0

This turned out to be because sometimes the btrfs ino would be the btree
inode number, and thus we'd skip calling the set extent delalloc bit
helper, and thus not adjust ->outstanding_extents.

Fix this by making sure we initialize test inodes with a valid inode
number so that we don't get random failures during self tests.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tests/btrfs-tests.c
fs/btrfs/tests/inode-tests.c