4 The 'setxattr' VFS method is used to modify the extended attributes
5 associated with a resource. The 'fsetxattr()' system call induces the
6 'setxattr' variant of the MDS_REINT RPC.
8 .Setxattr RPCs for Modifying a Resource's Extended Attributes
10 image::setxattr_rpcs.png["setxattr RPCs for modifying a resource's Extended Attributes",height=100]
12 //////////////////////////////////////////////////////////////////////
13 The setxattr_rpcs.png diagram resembles this text art:
17 ------- ------- -------
20 //////////////////////////////////////////////////////////////////////
22 *1 - The client issues an MDS_REINT with the REINT_SETXATTR
25 In addition to the 'ptlrpc_body' (RPC message header), the MDS_REINT
26 request RPC from the client has the REINT structure
27 'mdt_rec_setxattr', the name of the extended attribute in question,
28 the extended attribute data to put in place, and a lock request
29 'ldlm_request'. For a detailed discussion of all the fields in the
30 'mdt_rec_setxattr' and 'ldlm_request' refer to
31 <<struct-mdt-rec-setxattr>> and <<struct-ldlm-request>>.
33 .MDS_REINT:REINT_SETXATTR Request Packet Structure
34 image::mds-reint-setxattr-request.png["MDS_REINT:REINT_SETXATTR Request Packet Structure",height=50]
36 //////////////////////////////////////////////////////////////////////
37 The mds-reint-setxattr-request.png diagram resembles this text art:
40 --REINT_SETXATTR-request-------------------------
41 | ptlrpc_body | mdt_rec_setxattr | ldlm_request |
42 -------------------------------------------------
43 //////////////////////////////////////////////////////////////////////
45 See <<mds-reint-rpc>>.
47 The 'setxattr' wants to set the 'ctime' associated with the EA update
48 as well, so the one 'sx_valid' flag it uses is OBD_MD_FLCTIME
49 (0x00008). The 'sx_valid' field also has the OBD_MD_FLXATTR
50 (0x01000000000) flag set, though that is never checked or used.
52 The 'ldlm_request' structure encompasses an early lock cancellation
53 (see <<early-lock-cancellation>>) on the lock that the client had
54 previously acquired for the target resource. The lock handle
55 identifies this lock. Only lock_count and lock_handle are used, and
56 the rest of the ldlm_request is cleared, i.e. all fields set to
57 zero. In some instances the ldlm_request is empty (all zeros)
58 indicating early lock cancellation is not being used. This may be a
59 bug in the code for that instance.
61 *2 - The MDS_REINT reply acknowledges the updated attributes.*
63 In addition to the 'ptlrpc_body' (RPC message header), the MDS_REINT
64 reply RPC to the client has the 'mdt_body' structure. For a detailed
65 discussion of the fields in the 'mdt_body' refer to <<struct-mdt-body>>.
67 .MDS_REINT:REINT_SETXATTR Reply Packet Structure
68 image::mds-reint-setxattr-reply.png["MDS_REINT:REINT_SETXATTR Reply Packet Structure",height=50]
70 //////////////////////////////////////////////////////////////////////
71 The mds-reint-setxattr-reply.png diagram resembles this text art:
73 --REINT_SETXATTR-reply-----
74 | ptlrpc_body | mdt_body |
75 --------------------------
76 //////////////////////////////////////////////////////////////////////
78 The reply from the MDT after the setxattr operation has no valid
79 'mdt_body' fields, 'mbo_valid = 0x0.