Re: [PATCH 4/5] make extent_goto() deterministic when logical block not found

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

 



On Mon, Apr 07, 2008 at 10:00:59PM -0500, Eric Sandeen wrote:
> Make sure that extent_goto() leaves us at the last extent
> prior to the requested logical block, if the logical block
> requested lands in a hole.

Thanks, applied.  You do realize this won't necessarily do the right
thing if the sparse file doesn't have a block mapped at logical block
#0, and you then do an extent_goto() block 0, right?  Also, if
extent_get(EXT2_EXTENT_PREV_SIB) fails for various reasons, it still
could be non-deterministic.  Code that depends on this may want to do
some sanity checking.

Also, it might be prudent to check the return value here:

> +				retval = ext2fs_extent_get(handle,
> +							   EXT2_EXTENT_PREV_SIB,
> +							   &extent);
>  				return EXT2_ET_EXTENT_NOT_FOUND;

and return either the error returned by ext2fs_extent_get, or possibly
invent a new error code, say EXT2_ET_EXTENT_GOTO_BACKUP_FAILED and
return that if retval is non-zero.

I've left this as-is for now but there might be a potential robustness
problem hiding here.

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux