We were attempting to initialize inode hash info when no inodes were
found.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
if (ret < 0)
goto err;
- if (dir->first_this_inode)
+ if (dir->first_this_inode && dir->inodes.nr)
*hash_info = bch2_hash_info_init(c, &dir->inodes.data[0].inode);
dir->first_this_inode = false;
if (ret)
return ret;
- if (inode->first_this_inode)
+ if (inode->first_this_inode && inode->inodes.nr)
*hash_info = bch2_hash_info_init(c, &inode->inodes.data[0].inode);
inode->first_this_inode = false;