[Gluster-devel] Review request for patch: libglusterfs/syncop: Add xdata to all syncop calls

Raghavendra Talur rtalur at redhat.com
Wed Apr 1 10:31:59 UTC 2015


On Tuesday 31 March 2015 09:36 PM, Raghavendra Talur wrote:
> Hi,
>
> I have sent updated patch which adds xdata support to all syncop calls.
> It adds xdata in both request and response path of syncop.
>
> Considering that this patch has changes in many files,
> I request a quick review and merge to avoid rebase issues.
>
> Patch link http://review.gluster.org/#/c/9859/
> Bug Id: https://bugzilla.redhat.com/show_bug.cgi?id=1158621
>
> Thanks,
> Raghavendra Talur
>
Question regarding validity of xdata when op_ret < 0.

In this patch set I have syncop_*_cbk in this form


int
syncop_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
                    int op_ret, int op_errno, struct iatt *preparent,
                    struct iatt *postparent, dict_t *xdata)
{
         struct syncargs *args = NULL;

         args = cookie;

         args->op_ret   = op_ret;
         args->op_errno = op_errno;

         if (op_ret >= 0) {
                 if (xdata)
                         args->xdata  = dict_ref (xdata);
         }

         __wake (args);

         return 0;
}


where as the call stub has it like this

call_stub_t *
fop_rmdir_cbk_stub (call_frame_t *frame, fop_rmdir_cbk_t fn,
                     int32_t op_ret, int32_t op_errno,
                     struct iatt *preparent, struct iatt *postparent,
                     dict_t *xdata)
{
         call_stub_t *stub = NULL;

         GF_VALIDATE_OR_GOTO ("call-stub", frame, out);

         stub = stub_new (frame, 0, GF_FOP_RMDIR);
         GF_VALIDATE_OR_GOTO ("call-stub", stub, out);

         stub->fn_cbk.rmdir = fn;
         stub->args_cbk.op_ret = op_ret;
         stub->args_cbk.op_errno = op_errno;
         if (preparent)
                 stub->args_cbk.preparent = *preparent;
         if (postparent)
                 stub->args_cbk.postparent = *postparent;
         if (xdata)
                 stub->args_cbk.xdata = dict_ref (xdata);
out:
         return stub;
}


The difference being when xdata is considered to be valid.
call-stub considers it valid irrespective of op_ret value.

Is it always ok to consider xdata to be valid, even if op_ret < 0?

If yes, I will have to update the syncop_*_cbk calls to ref xdata
if they exist, irrespective of op_ret.

Also, it can be used in really cool ways, like we can have a
key called glusterfs.error_origin_xlator set to this->name of the xlator
where error originated and master xlators (fuse and gfapi) can log / make
use of it etc.

Thanks,
Raghavendra Talur





More information about the Gluster-devel mailing list