[Libguestfs] [PATCH v4 0/3] New API - find_block

Pino Toscano ptoscano at redhat.com
Tue Oct 11 08:56:17 UTC 2016


On Saturday, 8 October 2016 18:27:21 CEST Matteo Cafasso wrote:
> Patch ready for merging.
> 
> v4:
> 
>  - check return code of tsk_fs_attr_walk
>  - pass TSK_FS_FILE_WALK_FLAG_NOSPARSE as additional flag to
>  tsk_fs_attr_walk
> 
> After discussing with TSK authors the behaviour is clear. [1]

Thanks, this improves the situation a bit.

> In case of COMPRESSED blocks, the callback will be called for all the
> attributes no matter whether they are on disk or not (sparse). In
> such cases, the block address will be 0. [2]

Note that the API docs say:
  For compressed and sparse attributes, the address *may* be zero.
(emphasis is mine)

My concern is that, if the address in such cases is "unspecified", then
the comparisons in "attrwalk_callback" are done against a
random/unitialized value (which would be bad).

Also, if the block address would be zero, what's the point of having it
among the blocks tsk_fs_attr_walk() iterates over?

Thanks,
-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20161011/a8fc6c38/attachment.sig>


More information about the Libguestfs mailing list