Re: [PATCH 02/13] btrfs-progs: check: introduce function to find dir_item

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

 



On Thu, Jul 28, 2016 at 03:08:14PM +0800, Lu Fengqi wrote:
> +static int find_dir_item(struct btrfs_root *root, struct btrfs_key *ref_key,
> +			 struct btrfs_key *key, u64 index, char *name,
> +			 u32 namelen, u32 mode)
> +{
> +	struct btrfs_path *path;
> +	struct extent_buffer *node;
> +	struct btrfs_dir_item *di;
> +	struct btrfs_key location;
> +	char namebuf[BTRFS_NAME_LEN] = {0};
> +	u32 total;
> +	u32 cur = 0;
> +	u32 len;
> +	u32 name_len;
> +	u32 data_len;
> +	u8 filetype;
> +	int slot;
> +	int ret;
> +
> +	path = btrfs_alloc_path();

Unhandled error (and there's one more in check_root_ref). Also, the
function can return negative values, but the caller does not propagate
the falue as it rather expects the bitmask of the specific errors.

Fixing that seems to be more intrusive, as the whole callchain does not
expect that consistently.

Please fix that and resend the whole patchset.
--
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