Hide Forgot
Because it doesn't actually define an fsetxattr fop, DHT ends up using default_fsetxattr which passes through to FIRST_CHILD. Unfortunately, since the open would have gone to the cached/hashed subvol for this file, this means we're passing to a different protocol/client than we used for the open and we get EBADFD back . . . most of the time. 1/N times, the first volume will be the correct one and the call will work properly. This makes the behavior for open+fsetxattr both incorrect and inconsistent with the behavior for setxattr alone. The patch at the attached URL fixes this problem by defining an fsetxattr fop which redirects to the appropriate subvolume the same way as other calls do.
Hi Jeff, A minor change in your patch is needed: err: 47 + op_errno = (op_errno == -1) ? errno : op_errno; 48 + DHT_STACK_UNWIND (setxattr, frame, -1, op_errno); <--unwind needs to for fsetxattr call and not setxattr call
Nice catch. Thanks!
Hi Jeff, I will be re-sending this patch to GlusterFS mainline. Hope thats fine right? If you have concerns please let me know so we will not apply it (or revert it if applied). Regards, Amar
(In reply to comment #3) > I will be re-sending this patch to GlusterFS mainline. Hope thats fine right? > If you have concerns please let me know so we will not apply it (or revert it > if applied). No concerns here; I think that's excellent. Thanks, Amar.
PATCH: http://patches.gluster.com/patch/6213 in master (cluster/dht : implement a fsetxattr() command)