I'm afraid this doesn't fix it. So now err is init to 0, but then:
err = ext4_map_blocks(handle, inode, &map,
create ? EXT4_GET_BLOCKS_CREATE : 0);
so err is immediately reset to whatever ext4_map_blocks returns, which might be 0.
If so, we don't go down this case:
if (err < 0)
*errp = err;
and we do go down this case,
if (err <= 0)
return NULL;
in which case we return with *errp unset.
It needs something like this, though maybe this could be made prettier/clearer.
+ *errp = 0;
if (err < 0)
*errp = err;
if (err <= 0)
return NULL;
- *errp = 0;
Agreed. just initializing err variable into ext4_getblk() won't ensure *errp
will be filled with 'err' content. Thanks. I'll wait for some extra inputs and
see if is there anything else people have in mind, then release a v2 patch
--
--Carlos