Whamcloud - gitweb
c6b9cfb1f3d9c9a303e6186bea2810197ad345a0
[fs/lustre-release.git] / lustre / llite / xattr.c
1 /*
2  * GPL HEADER START
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 only,
8  * as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License version 2 for more details (a copy is included
14  * in the LICENSE file that accompanied this code).
15  *
16  * You should have received a copy of the GNU General Public License
17  * version 2 along with this program; If not, see
18  * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
19  *
20  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21  * CA 95054 USA or visit www.sun.com if you need additional information or
22  * have any questions.
23  *
24  * GPL HEADER END
25  */
26 /*
27  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
28  * Use is subject to license terms.
29  *
30  * Copyright (c) 2011, 2013, Intel Corporation.
31  */
32 /*
33  * This file is part of Lustre, http://www.lustre.org/
34  * Lustre is a trademark of Sun Microsystems, Inc.
35  */
36
37 #include <linux/fs.h>
38 #include <linux/sched.h>
39 #include <linux/mm.h>
40 #include <linux/selinux.h>
41
42 #define DEBUG_SUBSYSTEM S_LLITE
43
44 #include <obd_support.h>
45 #include <lustre_lite.h>
46 #include <lustre_dlm.h>
47 #include <lustre_ver.h>
48 #include <lustre_eacl.h>
49
50 #include "llite_internal.h"
51
52 #define XATTR_USER_T            (1)
53 #define XATTR_TRUSTED_T         (2)
54 #define XATTR_SECURITY_T        (3)
55 #define XATTR_ACL_ACCESS_T      (4)
56 #define XATTR_ACL_DEFAULT_T     (5)
57 #define XATTR_LUSTRE_T          (6)
58 #define XATTR_OTHER_T           (7)
59
60 static
61 int get_xattr_type(const char *name)
62 {
63         if (!strcmp(name, POSIX_ACL_XATTR_ACCESS))
64                 return XATTR_ACL_ACCESS_T;
65
66         if (!strcmp(name, POSIX_ACL_XATTR_DEFAULT))
67                 return XATTR_ACL_DEFAULT_T;
68
69         if (!strncmp(name, XATTR_USER_PREFIX,
70                      sizeof(XATTR_USER_PREFIX) - 1))
71                 return XATTR_USER_T;
72
73         if (!strncmp(name, XATTR_TRUSTED_PREFIX,
74                      sizeof(XATTR_TRUSTED_PREFIX) - 1))
75                 return XATTR_TRUSTED_T;
76
77         if (!strncmp(name, XATTR_SECURITY_PREFIX,
78                      sizeof(XATTR_SECURITY_PREFIX) - 1))
79                 return XATTR_SECURITY_T;
80
81         if (!strncmp(name, XATTR_LUSTRE_PREFIX,
82                      sizeof(XATTR_LUSTRE_PREFIX) - 1))
83                 return XATTR_LUSTRE_T;
84
85         return XATTR_OTHER_T;
86 }
87
88 static
89 int xattr_type_filter(struct ll_sb_info *sbi, int xattr_type)
90 {
91         if ((xattr_type == XATTR_ACL_ACCESS_T ||
92              xattr_type == XATTR_ACL_DEFAULT_T) &&
93            !(sbi->ll_flags & LL_SBI_ACL))
94                 return -EOPNOTSUPP;
95
96         if (xattr_type == XATTR_USER_T && !(sbi->ll_flags & LL_SBI_USER_XATTR))
97                 return -EOPNOTSUPP;
98         if (xattr_type == XATTR_TRUSTED_T && !cfs_capable(CFS_CAP_SYS_ADMIN))
99                 return -EPERM;
100         if (xattr_type == XATTR_OTHER_T)
101                 return -EOPNOTSUPP;
102
103         return 0;
104 }
105
106 static
107 int ll_setxattr_common(struct inode *inode, const char *name,
108                        const void *value, size_t size,
109                        int flags, __u64 valid)
110 {
111         struct ll_sb_info *sbi = ll_i2sbi(inode);
112         struct ptlrpc_request *req = NULL;
113         int xattr_type, rc;
114         struct obd_capa *oc;
115         posix_acl_xattr_header *new_value = NULL;
116         struct rmtacl_ctl_entry *rce = NULL;
117         ext_acl_xattr_header *acl = NULL;
118         const char *pv = value;
119         ENTRY;
120
121         xattr_type = get_xattr_type(name);
122         rc = xattr_type_filter(sbi, xattr_type);
123         if (rc)
124                 RETURN(rc);
125
126         /* b10667: ignore lustre special xattr for now */
127         if ((xattr_type == XATTR_TRUSTED_T && strcmp(name, "trusted.lov") == 0) ||
128             (xattr_type == XATTR_LUSTRE_T && strcmp(name, "lustre.lov") == 0))
129                 RETURN(0);
130
131         /* b15587: ignore security.capability xattr for now */
132         if ((xattr_type == XATTR_SECURITY_T &&
133             strcmp(name, "security.capability") == 0))
134                 RETURN(0);
135
136         /* LU-549:  Disable security.selinux when selinux is disabled */
137         if (xattr_type == XATTR_SECURITY_T && !selinux_is_enabled() &&
138             strcmp(name, "security.selinux") == 0)
139                 RETURN(-EOPNOTSUPP);
140
141 #ifdef CONFIG_FS_POSIX_ACL
142         if (sbi->ll_flags & LL_SBI_RMT_CLIENT &&
143             (xattr_type == XATTR_ACL_ACCESS_T ||
144             xattr_type == XATTR_ACL_DEFAULT_T)) {
145                 rce = rct_search(&sbi->ll_rct, current_pid());
146                 if (rce == NULL ||
147                     (rce->rce_ops != RMT_LSETFACL &&
148                     rce->rce_ops != RMT_RSETFACL))
149                         RETURN(-EOPNOTSUPP);
150
151                 if (rce->rce_ops == RMT_LSETFACL) {
152                         struct eacl_entry *ee;
153
154                         ee = et_search_del(&sbi->ll_et, current_pid(),
155                                            ll_inode2fid(inode), xattr_type);
156                         LASSERT(ee != NULL);
157                         if (valid & OBD_MD_FLXATTR) {
158                                 acl = lustre_acl_xattr_merge2ext(
159                                                 (posix_acl_xattr_header *)value,
160                                                 size, ee->ee_acl);
161                                 if (IS_ERR(acl)) {
162                                         ee_free(ee);
163                                         RETURN(PTR_ERR(acl));
164                                 }
165                                 size =  CFS_ACL_XATTR_SIZE(\
166                                                 le32_to_cpu(acl->a_count), \
167                                                 ext_acl_xattr);
168                                 pv = (const char *)acl;
169                         }
170                         ee_free(ee);
171                 } else if (rce->rce_ops == RMT_RSETFACL) {
172                         int acl_size = lustre_posix_acl_xattr_filter(
173                                                 (posix_acl_xattr_header *)value,
174                                                 size, &new_value);
175                         if (unlikely(acl_size < 0))
176                                 RETURN(acl_size);
177                         size = acl_size;
178
179                         pv = (const char *)new_value;
180                 } else
181                         RETURN(-EOPNOTSUPP);
182
183                 valid |= rce_ops2valid(rce->rce_ops);
184         }
185 #endif
186         if (sbi->ll_xattr_cache_enabled &&
187             (rce == NULL || rce->rce_ops == RMT_LSETFACL)) {
188                 rc = ll_xattr_cache_update(inode, name, pv, size, valid, flags);
189         } else {
190                 oc = ll_mdscapa_get(inode);
191                 rc = md_setxattr(sbi->ll_md_exp, ll_inode2fid(inode), oc,
192                                 valid, name, pv, size, 0, flags,
193                                 ll_i2suppgid(inode), &req);
194                 capa_put(oc);
195         }
196
197 #ifdef CONFIG_FS_POSIX_ACL
198         if (new_value != NULL)
199                 lustre_posix_acl_xattr_free(new_value, size);
200         if (acl != NULL)
201                 lustre_ext_acl_xattr_free(acl);
202 #endif
203         if (rc) {
204                 if (rc == -EOPNOTSUPP && xattr_type == XATTR_USER_T) {
205                         LCONSOLE_INFO("Disabling user_xattr feature because "
206                                       "it is not supported on the server\n");
207                         sbi->ll_flags &= ~LL_SBI_USER_XATTR;
208                 }
209                 RETURN(rc);
210         }
211
212         ptlrpc_req_finished(req);
213         RETURN(0);
214 }
215
216 int ll_setxattr(struct dentry *dentry, const char *name,
217                 const void *value, size_t size, int flags)
218 {
219         struct inode *inode = dentry->d_inode;
220
221         LASSERT(inode);
222         LASSERT(name);
223
224         CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p), xattr %s\n",
225                inode->i_ino, inode->i_generation, inode, name);
226
227         ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_SETXATTR, 1);
228
229         if ((strncmp(name, XATTR_TRUSTED_PREFIX,
230                      sizeof(XATTR_TRUSTED_PREFIX) - 1) == 0 &&
231              strcmp(name + sizeof(XATTR_TRUSTED_PREFIX) - 1, "lov") == 0) ||
232             (strncmp(name, XATTR_LUSTRE_PREFIX,
233                      sizeof(XATTR_LUSTRE_PREFIX) - 1) == 0 &&
234              strcmp(name + sizeof(XATTR_LUSTRE_PREFIX) - 1, "lov") == 0)) {
235                 struct lov_user_md *lump = (struct lov_user_md *)value;
236                 int rc = 0;
237
238                 /* Attributes that are saved via getxattr will always have
239                  * the stripe_offset as 0.  Instead, the MDS should be
240                  * allowed to pick the starting OST index.   b=17846 */
241                 if (lump != NULL && lump->lmm_stripe_offset == 0)
242                         lump->lmm_stripe_offset = -1;
243
244                 if (lump != NULL && S_ISREG(inode->i_mode)) {
245                         struct file     f;
246                         __u64           it_flags = FMODE_WRITE;
247                         int lum_size = (lump->lmm_magic == LOV_USER_MAGIC_V1) ?
248                                 sizeof(*lump) : sizeof(struct lov_user_md_v3);
249
250                         f.f_dentry = dentry;
251                         rc = ll_lov_setstripe_ea_info(inode, &f, it_flags, lump,
252                                                       lum_size);
253                         /* b10667: rc always be 0 here for now */
254                         rc = 0;
255                 } else if (S_ISDIR(inode->i_mode)) {
256                         rc = ll_dir_setstripe(inode, lump, 0);
257                 }
258
259                 return rc;
260
261         } else if (strcmp(name, XATTR_NAME_LMA) == 0 ||
262                    strcmp(name, XATTR_NAME_LINK) == 0)
263                 return 0;
264
265         return ll_setxattr_common(inode, name, value, size, flags,
266                                   OBD_MD_FLXATTR);
267 }
268
269 int ll_removexattr(struct dentry *dentry, const char *name)
270 {
271         struct inode *inode = dentry->d_inode;
272
273         LASSERT(inode);
274         LASSERT(name);
275
276         CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p), xattr %s\n",
277                inode->i_ino, inode->i_generation, inode, name);
278
279         ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_REMOVEXATTR, 1);
280         return ll_setxattr_common(inode, name, NULL, 0, 0,
281                                   OBD_MD_FLXATTRRM);
282 }
283
284 static
285 int ll_getxattr_common(struct inode *inode, const char *name,
286                        void *buffer, size_t size, __u64 valid)
287 {
288         struct ll_sb_info *sbi = ll_i2sbi(inode);
289         struct ptlrpc_request *req = NULL;
290         struct mdt_body *body;
291         int xattr_type, rc;
292         void *xdata;
293         struct obd_capa *oc;
294         struct rmtacl_ctl_entry *rce = NULL;
295         ENTRY;
296
297         CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p)\n",
298                inode->i_ino, inode->i_generation, inode);
299
300         /* listxattr have slightly different behavior from of ext3:
301          * without 'user_xattr' ext3 will list all xattr names but
302          * filtered out "^user..*"; we list them all for simplicity.
303          */
304         if (!name) {
305                 xattr_type = XATTR_OTHER_T;
306                 goto do_getxattr;
307         }
308
309         xattr_type = get_xattr_type(name);
310         rc = xattr_type_filter(sbi, xattr_type);
311         if (rc)
312                 RETURN(rc);
313
314         /* b15587: ignore security.capability xattr for now */
315         if ((xattr_type == XATTR_SECURITY_T &&
316             strcmp(name, "security.capability") == 0))
317                 RETURN(-ENODATA);
318
319         /* LU-549:  Disable security.selinux when selinux is disabled */
320         if (xattr_type == XATTR_SECURITY_T && !selinux_is_enabled() &&
321             strcmp(name, "security.selinux") == 0)
322                 RETURN(-EOPNOTSUPP);
323
324 #ifdef CONFIG_FS_POSIX_ACL
325         if (sbi->ll_flags & LL_SBI_RMT_CLIENT &&
326             (xattr_type == XATTR_ACL_ACCESS_T ||
327             xattr_type == XATTR_ACL_DEFAULT_T)) {
328                 rce = rct_search(&sbi->ll_rct, current_pid());
329                 if (rce == NULL ||
330                     (rce->rce_ops != RMT_LSETFACL &&
331                     rce->rce_ops != RMT_LGETFACL &&
332                     rce->rce_ops != RMT_RSETFACL &&
333                     rce->rce_ops != RMT_RGETFACL))
334                         RETURN(-EOPNOTSUPP);
335         }
336
337         /* posix acl is under protection of LOOKUP lock. when calling to this,
338          * we just have path resolution to the target inode, so we have great
339          * chance that cached ACL is uptodate.
340          */
341         if (xattr_type == XATTR_ACL_ACCESS_T &&
342             !(sbi->ll_flags & LL_SBI_RMT_CLIENT)) {
343                 struct ll_inode_info *lli = ll_i2info(inode);
344                 struct posix_acl *acl;
345
346                 spin_lock(&lli->lli_lock);
347                 acl = posix_acl_dup(lli->lli_posix_acl);
348                 spin_unlock(&lli->lli_lock);
349
350                 if (!acl)
351                         RETURN(-ENODATA);
352
353                 rc = posix_acl_to_xattr(&init_user_ns, acl, buffer, size);
354                 posix_acl_release(acl);
355                 RETURN(rc);
356         }
357         if (xattr_type == XATTR_ACL_DEFAULT_T && !S_ISDIR(inode->i_mode))
358                 RETURN(-ENODATA);
359 #endif
360
361 do_getxattr:
362         if (sbi->ll_xattr_cache_enabled && (rce == NULL ||
363                                             rce->rce_ops == RMT_LGETFACL ||
364                                             rce->rce_ops == RMT_LSETFACL)) {
365                 rc = ll_xattr_cache_get(inode, name, buffer, size, valid);
366                 if (rc < 0)
367                         GOTO(out_xattr, rc);
368         } else {
369                 oc = ll_mdscapa_get(inode);
370                 rc = md_getxattr(sbi->ll_md_exp, ll_inode2fid(inode), oc,
371                                 valid | (rce ? rce_ops2valid(rce->rce_ops) : 0),
372                                 name, NULL, 0, size, 0, &req);
373                 capa_put(oc);
374
375                 if (rc < 0)
376                         GOTO(out_xattr, rc);
377
378                 body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
379                 LASSERT(body);
380
381                 /* only detect the xattr size */
382                 if (size == 0)
383                         GOTO(out, rc = body->eadatasize);
384
385                 if (size < body->eadatasize) {
386                         CERROR("server bug: replied size %u > %u\n",
387                                 body->eadatasize, (int)size);
388                         GOTO(out, rc = -ERANGE);
389                 }
390
391                 if (body->eadatasize == 0)
392                         GOTO(out, rc = -ENODATA);
393
394                 /* do not need swab xattr data */
395                 xdata = req_capsule_server_sized_get(&req->rq_pill, &RMF_EADATA,
396                                                         body->eadatasize);
397                 if (!xdata)
398                         GOTO(out, rc = -EFAULT);
399
400                 memcpy(buffer, xdata, body->eadatasize);
401                 rc = body->eadatasize;
402         }
403
404 #ifdef CONFIG_FS_POSIX_ACL
405         if (rce != NULL && rce->rce_ops == RMT_LSETFACL) {
406                 ext_acl_xattr_header *acl;
407
408                 acl = lustre_posix_acl_xattr_2ext(buffer, rc);
409                 if (IS_ERR(acl))
410                         GOTO(out, rc = PTR_ERR(acl));
411
412                 rc = ee_add(&sbi->ll_et, current_pid(), ll_inode2fid(inode),
413                             xattr_type, acl);
414                 if (unlikely(rc < 0)) {
415                         lustre_ext_acl_xattr_free(acl);
416                         GOTO(out, rc);
417                 }
418         }
419 #endif
420         EXIT;
421
422 out_xattr:
423         if (rc == -EOPNOTSUPP && xattr_type == XATTR_USER_T) {
424                 LCONSOLE_INFO("%s: disabling user_xattr feature because "
425                                 "it is not supported on the server: rc = %d\n",
426                                 ll_get_fsname(inode->i_sb, NULL, 0), rc);
427                 sbi->ll_flags &= ~LL_SBI_USER_XATTR;
428         }
429 out:
430         ptlrpc_req_finished(req);
431         return rc;
432 }
433
434 ssize_t ll_getxattr(struct dentry *dentry, const char *name,
435                     void *buffer, size_t size)
436 {
437         struct inode *inode = dentry->d_inode;
438
439         LASSERT(inode);
440         LASSERT(name);
441
442         CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p), xattr %s\n",
443                inode->i_ino, inode->i_generation, inode, name);
444
445         ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_GETXATTR, 1);
446
447         if ((strncmp(name, XATTR_TRUSTED_PREFIX,
448                      sizeof(XATTR_TRUSTED_PREFIX) - 1) == 0 &&
449              strcmp(name + sizeof(XATTR_TRUSTED_PREFIX) - 1, "lov") == 0) ||
450             (strncmp(name, XATTR_LUSTRE_PREFIX,
451                      sizeof(XATTR_LUSTRE_PREFIX) - 1) == 0 &&
452              strcmp(name + sizeof(XATTR_LUSTRE_PREFIX) - 1, "lov") == 0)) {
453                 struct lov_stripe_md *lsm;
454                 struct lov_user_md *lump;
455                 struct lov_mds_md *lmm = NULL;
456                 struct ptlrpc_request *request = NULL;
457                 int rc = 0, lmmsize = 0;
458
459                 if (!S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode))
460                         return -ENODATA;
461
462                 if (size == 0 && S_ISDIR(inode->i_mode)) {
463                         /* XXX directory EA is fix for now, optimize to save
464                          * RPC transfer */
465                         GOTO(out, rc = sizeof(struct lov_user_md));
466                 }
467
468                 lsm = ccc_inode_lsm_get(inode);
469                 if (lsm == NULL) {
470                         if (S_ISDIR(inode->i_mode)) {
471                                 rc = ll_dir_getstripe(inode, &lmm,
472                                                       &lmmsize, &request);
473                         } else {
474                                 rc = -ENODATA;
475                         }
476                 } else {
477                         /* LSM is present already after lookup/getattr call.
478                          * we need to grab layout lock once it is implemented */
479                         rc = obd_packmd(ll_i2dtexp(inode), &lmm, lsm);
480                         lmmsize = rc;
481                 }
482                 ccc_inode_lsm_put(inode, lsm);
483
484                 if (rc < 0)
485                        GOTO(out, rc);
486
487                 if (size == 0) {
488                         /* used to call ll_get_max_mdsize() forward to get
489                          * the maximum buffer size, while some apps (such as
490                          * rsync 3.0.x) care much about the exact xattr value
491                          * size */
492                         rc = lmmsize;
493                         GOTO(out, rc);
494                 }
495
496                 if (size < lmmsize) {
497                         CERROR("server bug: replied size %d > %d for %s (%s)\n",
498                                lmmsize, (int)size, dentry->d_name.name, name);
499                         GOTO(out, rc = -ERANGE);
500                 }
501
502                 lump = (struct lov_user_md *)buffer;
503                 memcpy(lump, lmm, lmmsize);
504                 /* do not return layout gen for getxattr otherwise it would
505                  * confuse tar --xattr by recognizing layout gen as stripe
506                  * offset when the file is restored. See LU-2809. */
507                 lump->lmm_layout_gen = 0;
508
509                 rc = lmmsize;
510 out:
511                 if (request)
512                         ptlrpc_req_finished(request);
513                 else if (lmm)
514                         obd_free_diskmd(ll_i2dtexp(inode), &lmm);
515                 return(rc);
516         }
517
518         return ll_getxattr_common(inode, name, buffer, size, OBD_MD_FLXATTR);
519 }
520
521 ssize_t ll_listxattr(struct dentry *dentry, char *buffer, size_t size)
522 {
523         struct inode *inode = dentry->d_inode;
524         int rc = 0, rc2 = 0;
525         struct lov_mds_md *lmm = NULL;
526         struct ptlrpc_request *request = NULL;
527         int lmmsize;
528
529         LASSERT(inode);
530
531         CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p)\n",
532                inode->i_ino, inode->i_generation, inode);
533
534         ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_LISTXATTR, 1);
535
536         rc = ll_getxattr_common(inode, NULL, buffer, size, OBD_MD_FLXATTRLS);
537         if (rc < 0)
538                 GOTO(out, rc);
539
540         if (buffer != NULL) {
541                 struct ll_sb_info *sbi = ll_i2sbi(inode);
542                 char *xattr_name = buffer;
543                 int xlen, rem = rc;
544
545                 while (rem > 0) {
546                         xlen = strnlen(xattr_name, rem - 1) + 1;
547                         rem -= xlen;
548                         if (xattr_type_filter(sbi,
549                                         get_xattr_type(xattr_name)) == 0) {
550                                 /* skip OK xattr type
551                                  * leave it in buffer
552                                  */
553                                 xattr_name += xlen;
554                                 continue;
555                         }
556                         /* move up remaining xattrs in buffer
557                          * removing the xattr that is not OK
558                          */
559                         memmove(xattr_name, xattr_name + xlen, rem);
560                         rc -= xlen;
561                 }
562         }
563         if (S_ISREG(inode->i_mode)) {
564                 if (!ll_i2info(inode)->lli_has_smd)
565                         rc2 = -1;
566         } else if (S_ISDIR(inode->i_mode)) {
567                 rc2 = ll_dir_getstripe(inode, &lmm, &lmmsize, &request);
568         }
569
570         if (rc2 < 0) {
571                 GOTO(out, rc2 = 0);
572         } else if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)) {
573                 const int prefix_len = sizeof(XATTR_LUSTRE_PREFIX) - 1;
574                 const size_t name_len   = sizeof("lov") - 1;
575                 const size_t total_len  = prefix_len + name_len + 1;
576
577                 if (((rc + total_len) > size) && (buffer != NULL)) {
578                         ptlrpc_req_finished(request);
579                         return -ERANGE;
580                 }
581
582                 if (buffer != NULL) {
583                         buffer += rc;
584                         memcpy(buffer, XATTR_LUSTRE_PREFIX, prefix_len);
585                         memcpy(buffer + prefix_len, "lov", name_len);
586                         buffer[prefix_len + name_len] = '\0';
587                 }
588                 rc2 = total_len;
589         }
590 out:
591         ptlrpc_req_finished(request);
592         rc = rc + rc2;
593
594         return rc;
595 }