Re: [PATCH] Btrfs-progs: repair missing dir index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm redoing this patch a bit so don't take it yet. Thanks,

Josef

David Sterba <dsterba@xxxxxxx> wrote:


On Thu, Oct 02, 2014 at 02:50:39PM -0400, Josef Bacik wrote:
> +static int repair_inode_backrefs(struct btrfs_root *root,
> +                              struct inode_record *rec,
> +                              struct cache_tree *inode_cache)
> +{
> +     struct btrfs_trans_handle *trans;
> +     struct btrfs_path *path;
> +     struct inode_backref *tmp, *backref;
> +     u64 root_dirid = btrfs_root_dirid(&root->root_item);
> +     int ret;

Changed to ret = 1,

> +     list_for_each_entry_safe(backref, tmp, &rec->backrefs, list) {
[...]
> +     }

gcc prints warning about possibly unitilized ret here:

> +     BUG_ON(repaired && ret); /* Poor mans transaction abort */

So it would abort in case the list_for_each loop does not execute for
some reason.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux