[illumos-Developer] iSCSI UNMAP with DKIOCFREE

Dan McDonald danmcd at nexenta.com
Mon Feb 21 18:36:18 PST 2011


On Mon, Feb 21, 2011 at 09:21:55PM -0500, Dan McDonald wrote:
> On Mon, Feb 21, 2011 at 06:09:40PM -0800, George Wilson wrote:
> > zvol.c:
> > 
> > - need error checking for the range [df_start, df_start + df_length)
> >     - ensure that df_start + df_length <= zv_volsize
> 
> Will do!

Done, returning EINVAL on failure.

> >     - ensure that df_start >= 0
> 
> I thought that data type was unsigned...
> 
> everywhere(~)[0]% grep diskaddr_t /usr/include/sys/types.h 
> typedef	u_longlong_t	diskaddr_t;
> everywhere(~)[0]% 
> 
> Is a >= 0 check still valid?  Should I do some unsigned equivalent thereof
> (<= LLONG_MAX)?

I went ahead and did this check, also returning EINVAL on failure.

> > - need to call zfs_range_lock() for the range specified by df (need
> > unlock too)
> 
> Makes sense and will do.

Done, with one question (see below).

> > - I think we also need to log this operation to the zil so that it
> > can be replayed on reboot (I'm digging into dmu_free_long_range() to
> > see if it tracks the deletion)
> 
> Please report back with these results, and an answer to my LLONG_MAX-ish
> question?

So I've implemented all of your suggested changes, modulo the zil logging.  I
have one question, and that's whether or not I need to place the
zfs_range_unlock() *after* the optional txg_wait_synced().  The previous
webrev is now updated:

	http://www.kebe.com/~danmcd/webrevs/unmap/

Thanks,
Dan



More information about the Developer mailing list