Re: [PATCH] Btrfs: extended inode refs support for send mechanism

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

 



Hi Alex,

On Thu, October 11, 2012 at 13:11 (+0200), Alex Lyakas wrote:
>> @@ -993,12 +1010,17 @@ static int get_inode_path(struct send_ctx *sctx, struct btrfs_root *root,
>>         if (ret < 0)
>>                 goto out;
>>         if (ret) {
>> -               ret = 1;
>> -               goto out;
>> +               key.type = BTRFS_INODE_EXTREF_KEY;
> According to code, btrfs_search_slot_for_read(INODE_REF,
> find_higher=1, return_any=0) returns 1, only in case btrfs_next_leaf()
> returns 1, which means there are no more items at all (or, if you have
> Josef's patch, no more items with the same objectid). Otherwise, it
> may bring us to INODE_EXTREF, but key.type will still be INODE_REF,
> while found_key.type will be INODE_EXTREF. So the test below that
> compares key and found_key will make us return -ENOENT. And in case
> btrfs_search_slot_for_read() returns 1, we don't have to search more,
> I think.
> So shouldn't it be something like:
> ret = btrfs_search_slot_for_read(INODE_REF, find_higher=1, return_any=0)
> if (ret) {
>     ret =1
>     goto out;
> }
> btrfs_item_key_to_cpu(p->nodes[0], &found_key, p->slots[0]);
> if (found_key.objectid != ino || (found_key.type!= INODE_REF &&
> found_key.type != INODE_EXTREF))
> ...

You're right, good catch. I forgot btrfs_search_slot_for_read is actually pretty
different. I'll make a fix.

Thanks!
-Jan
--
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