Line data Source code
1 : // SPDX-License-Identifier: GPL-2.0
2 : /*
3 : * Copyright (c) 2000-2005 Silicon Graphics, Inc.
4 : * Copyright (c) 2013 Red Hat, Inc.
5 : * All Rights Reserved.
6 : */
7 : #include "xfs.h"
8 : #include "xfs_fs.h"
9 : #include "xfs_shared.h"
10 : #include "xfs_format.h"
11 : #include "xfs_log_format.h"
12 : #include "xfs_trans_resv.h"
13 : #include "xfs_mount.h"
14 : #include "xfs_da_format.h"
15 : #include "xfs_inode.h"
16 : #include "xfs_trans.h"
17 : #include "xfs_bmap.h"
18 : #include "xfs_da_btree.h"
19 : #include "xfs_attr.h"
20 : #include "xfs_attr_sf.h"
21 : #include "xfs_attr_leaf.h"
22 : #include "xfs_error.h"
23 : #include "xfs_trace.h"
24 : #include "xfs_dir2.h"
25 : #include "xfs_health.h"
26 :
27 : STATIC int
28 19847224 : xfs_attr_shortform_compare(const void *a, const void *b)
29 : {
30 19847224 : xfs_attr_sf_sort_t *sa, *sb;
31 :
32 19847224 : sa = (xfs_attr_sf_sort_t *)a;
33 19847224 : sb = (xfs_attr_sf_sort_t *)b;
34 19847224 : if (sa->hash < sb->hash) {
35 : return -1;
36 9926795 : } else if (sa->hash > sb->hash) {
37 : return 1;
38 : } else {
39 223 : return sa->entno - sb->entno;
40 : }
41 : }
42 :
43 : #define XFS_ISRESET_CURSOR(cursor) \
44 : (!((cursor)->initted) && !((cursor)->hashval) && \
45 : !((cursor)->blkno) && !((cursor)->offset))
46 : /*
47 : * Copy out entries of shortform attribute lists for attr_list().
48 : * Shortform attribute lists are not stored in hashval sorted order.
49 : * If the output buffer is not large enough to hold them all, then
50 : * we have to calculate each entries' hashvalue and sort them before
51 : * we can begin returning them to the user.
52 : */
53 : static int
54 405332194 : xfs_attr_shortform_list(
55 : struct xfs_attr_list_context *context)
56 : {
57 405332194 : struct xfs_attrlist_cursor_kern *cursor = &context->cursor;
58 405332194 : struct xfs_inode *dp = context->dp;
59 405332194 : struct xfs_attr_sf_sort *sbuf, *sbp;
60 405332194 : struct xfs_attr_shortform *sf;
61 405332194 : struct xfs_attr_sf_entry *sfe;
62 405332194 : struct xfs_mount *mp;
63 405332194 : int sbsize, nsbuf, count, i;
64 405332194 : int error = 0;
65 :
66 405332194 : ASSERT(context != NULL);
67 405332194 : ASSERT(dp != NULL);
68 405332194 : mp = dp->i_mount;
69 405332194 : sf = (struct xfs_attr_shortform *)dp->i_af.if_u1.if_data;
70 405332194 : ASSERT(sf != NULL);
71 405332194 : if (!sf->hdr.count)
72 : return 0;
73 :
74 405232512 : trace_xfs_attr_list_sf(context);
75 :
76 : /*
77 : * If the buffer is large enough and the cursor is at the start,
78 : * do not bother with sorting since we will return everything in
79 : * one buffer and another call using the cursor won't need to be
80 : * made.
81 : * Note the generous fudge factor of 16 overhead bytes per entry.
82 : * If bufsize is zero then put_listent must be a search function
83 : * and can just scan through what we have.
84 : */
85 405227743 : if (context->bufsize == 0 ||
86 400494963 : (XFS_ISRESET_CURSOR(cursor) &&
87 400494021 : (dp->i_af.if_bytes + sf->hdr.count * 16) < context->bufsize)) {
88 915522684 : for (i = 0, sfe = &sf->list[0]; i < sf->hdr.count; i++) {
89 513699451 : if (XFS_IS_CORRUPT(context->dp->i_mount,
90 : !xfs_attr_namecheck(mp, sfe->nameval,
91 : sfe->namelen,
92 : sfe->flags))) {
93 2 : xfs_dirattr_mark_sick(context->dp, XFS_ATTR_FORK);
94 2 : return -EFSCORRUPTED;
95 : }
96 513741008 : context->put_listent(context,
97 513741008 : sfe->flags,
98 : sfe->nameval,
99 513741008 : (int)sfe->namelen,
100 513741008 : &sfe->nameval[sfe->namelen],
101 513741008 : (int)sfe->valuelen);
102 : /*
103 : * Either search callback finished early or
104 : * didn't fit it all in the buffer after all.
105 : */
106 513795828 : if (context->seen_enough)
107 : break;
108 513795828 : sfe = xfs_attr_sf_nextentry(sfe);
109 : }
110 401823233 : trace_xfs_attr_list_sf_all(context);
111 401823233 : return 0;
112 : }
113 :
114 : /* do no more for a search callback */
115 3500887 : if (context->bufsize == 0)
116 : return 0;
117 :
118 : /*
119 : * It didn't all fit, so we have to sort everything on hashval.
120 : */
121 3500887 : sbsize = sf->hdr.count * sizeof(*sbuf);
122 3500887 : sbp = sbuf = kmem_alloc(sbsize, KM_NOFS);
123 :
124 : /*
125 : * Scan the attribute list for the rest of the entries, storing
126 : * the relevant info from only those that match into a buffer.
127 : */
128 3508448 : nsbuf = 0;
129 16040335 : for (i = 0, sfe = &sf->list[0]; i < sf->hdr.count; i++) {
130 12531885 : if (unlikely(
131 : ((char *)sfe < (char *)sf) ||
132 : ((char *)sfe >= ((char *)sf + dp->i_af.if_bytes)))) {
133 0 : XFS_CORRUPTION_ERROR("xfs_attr_shortform_list",
134 : XFS_ERRLEVEL_LOW,
135 : context->dp->i_mount, sfe,
136 : sizeof(*sfe));
137 0 : kmem_free(sbuf);
138 0 : xfs_dirattr_mark_sick(dp, XFS_ATTR_FORK);
139 0 : return -EFSCORRUPTED;
140 : }
141 :
142 12531885 : sbp->entno = i;
143 12531885 : sbp->hash = xfs_da_hashname(sfe->nameval, sfe->namelen);
144 12531887 : sbp->name = sfe->nameval;
145 12531887 : sbp->namelen = sfe->namelen;
146 : /* These are bytes, and both on-disk, don't endian-flip */
147 12531887 : sbp->value = &sfe->nameval[sfe->namelen],
148 12531887 : sbp->valuelen = sfe->valuelen;
149 12531887 : sbp->flags = sfe->flags;
150 12531887 : sfe = xfs_attr_sf_nextentry(sfe);
151 12531887 : sbp++;
152 12531887 : nsbuf++;
153 : }
154 :
155 : /*
156 : * Sort the entries on hash then entno.
157 : */
158 3508450 : xfs_sort(sbuf, nsbuf, sizeof(*sbuf), xfs_attr_shortform_compare);
159 :
160 : /*
161 : * Re-find our place IN THE SORTED LIST.
162 : */
163 3508439 : count = 0;
164 3508439 : cursor->initted = 1;
165 3508439 : cursor->blkno = 0;
166 3508439 : for (sbp = sbuf, i = 0; i < nsbuf; i++, sbp++) {
167 3508431 : if (sbp->hash == cursor->hashval) {
168 0 : if (cursor->offset == count) {
169 : break;
170 : }
171 0 : count++;
172 3508431 : } else if (sbp->hash > cursor->hashval) {
173 : break;
174 : }
175 : }
176 3508439 : if (i == nsbuf)
177 0 : goto out;
178 :
179 : /*
180 : * Loop putting entries into the user buffer.
181 : */
182 16040144 : for ( ; i < nsbuf; i++, sbp++) {
183 12531696 : if (cursor->hashval != sbp->hash) {
184 12531500 : cursor->hashval = sbp->hash;
185 12531500 : cursor->offset = 0;
186 : }
187 12531696 : if (XFS_IS_CORRUPT(context->dp->i_mount,
188 : !xfs_attr_namecheck(mp, sbp->name,
189 : sbp->namelen,
190 : sbp->flags))) {
191 0 : xfs_dirattr_mark_sick(context->dp, XFS_ATTR_FORK);
192 0 : error = -EFSCORRUPTED;
193 0 : goto out;
194 : }
195 12531641 : context->put_listent(context,
196 12531641 : sbp->flags,
197 : sbp->name,
198 12531641 : sbp->namelen,
199 : sbp->value,
200 12531641 : sbp->valuelen);
201 12531713 : if (context->seen_enough)
202 : break;
203 12531705 : cursor->offset++;
204 : }
205 3508456 : out:
206 3508456 : kmem_free(sbuf);
207 3508456 : return error;
208 : }
209 :
210 : /*
211 : * We didn't find the block & hash mentioned in the cursor state, so
212 : * walk down the attr btree looking for the hash.
213 : */
214 : STATIC int
215 973636 : xfs_attr_node_list_lookup(
216 : struct xfs_attr_list_context *context,
217 : struct xfs_attrlist_cursor_kern *cursor,
218 : struct xfs_buf **pbp)
219 : {
220 973636 : struct xfs_da3_icnode_hdr nodehdr;
221 973636 : struct xfs_da_intnode *node;
222 973636 : struct xfs_da_node_entry *btree;
223 973636 : struct xfs_inode *dp = context->dp;
224 973636 : struct xfs_mount *mp = dp->i_mount;
225 973636 : struct xfs_trans *tp = context->tp;
226 973636 : struct xfs_buf *bp;
227 973636 : xfs_failaddr_t fa;
228 973636 : int i;
229 973636 : int error = 0;
230 973636 : unsigned int expected_level = 0;
231 973636 : uint16_t magic;
232 :
233 973636 : ASSERT(*pbp == NULL);
234 973636 : cursor->blkno = 0;
235 2029309 : for (;;) {
236 2029309 : error = xfs_da3_node_read(tp, dp, cursor->blkno, &bp,
237 : XFS_ATTR_FORK);
238 2029288 : if (error)
239 0 : return error;
240 2029288 : node = bp->b_addr;
241 2029288 : magic = be16_to_cpu(node->hdr.info.magic);
242 2029288 : if (magic == XFS_ATTR_LEAF_MAGIC ||
243 2029288 : magic == XFS_ATTR3_LEAF_MAGIC)
244 : break;
245 1055659 : if (magic != XFS_DA_NODE_MAGIC &&
246 1055659 : magic != XFS_DA3_NODE_MAGIC) {
247 0 : XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp,
248 : node, sizeof(*node));
249 0 : goto out_corruptbuf;
250 : }
251 :
252 1055659 : fa = xfs_da3_node_header_check(bp, dp->i_ino);
253 1055672 : if (fa)
254 0 : goto out_corruptbuf;
255 :
256 1055672 : xfs_da3_node_hdr_from_disk(mp, &nodehdr, node);
257 :
258 : /* Tree taller than we can handle; bail out! */
259 1055667 : if (nodehdr.level >= XFS_DA_NODE_MAXDEPTH)
260 0 : goto out_corruptbuf;
261 :
262 : /* Check the level from the root node. */
263 1055667 : if (cursor->blkno == 0)
264 973410 : expected_level = nodehdr.level - 1;
265 82257 : else if (expected_level != nodehdr.level)
266 0 : goto out_corruptbuf;
267 : else
268 82257 : expected_level--;
269 :
270 1055667 : btree = nodehdr.btree;
271 1055664 : for (i = 0; i < nodehdr.count; btree++, i++) {
272 2111326 : if (cursor->hashval <= be32_to_cpu(btree->hashval)) {
273 1055666 : cursor->blkno = be32_to_cpu(btree->before);
274 1055666 : trace_xfs_attr_list_node_descend(context,
275 : btree);
276 1055666 : break;
277 : }
278 : }
279 1055668 : xfs_trans_brelse(tp, bp);
280 :
281 1055673 : if (i == nodehdr.count)
282 : return 0;
283 :
284 : /* We can't point back to the root. */
285 1055673 : if (XFS_IS_CORRUPT(mp, cursor->blkno == 0)) {
286 0 : xfs_dirattr_mark_sick(dp, XFS_ATTR_FORK);
287 0 : return -EFSCORRUPTED;
288 : }
289 : }
290 :
291 973629 : fa = xfs_attr3_leaf_header_check(bp, dp->i_ino);
292 973629 : if (fa) {
293 0 : __xfs_buf_mark_corrupt(bp, fa);
294 0 : goto out_releasebuf;
295 : }
296 :
297 973629 : if (expected_level != 0)
298 0 : goto out_corruptbuf;
299 :
300 973629 : *pbp = bp;
301 973629 : return 0;
302 :
303 0 : out_corruptbuf:
304 0 : xfs_buf_mark_corrupt(bp);
305 0 : out_releasebuf:
306 0 : xfs_trans_brelse(tp, bp);
307 0 : xfs_dirattr_mark_sick(dp, XFS_ATTR_FORK);
308 0 : return -EFSCORRUPTED;
309 : }
310 :
311 : STATIC int
312 973673 : xfs_attr_node_list(
313 : struct xfs_attr_list_context *context)
314 : {
315 973673 : struct xfs_attrlist_cursor_kern *cursor = &context->cursor;
316 973673 : struct xfs_attr3_icleaf_hdr leafhdr;
317 973673 : struct xfs_attr_leafblock *leaf;
318 973673 : struct xfs_da_intnode *node;
319 973673 : struct xfs_buf *bp;
320 973673 : struct xfs_inode *dp = context->dp;
321 973673 : struct xfs_mount *mp = dp->i_mount;
322 973673 : xfs_failaddr_t fa;
323 973673 : int error = 0;
324 :
325 973673 : trace_xfs_attr_node_list(context);
326 :
327 973679 : cursor->initted = 1;
328 :
329 : /*
330 : * Do all sorts of validation on the passed-in cursor structure.
331 : * If anything is amiss, ignore the cursor and look up the hashval
332 : * starting from the btree root.
333 : */
334 973679 : bp = NULL;
335 973679 : if (cursor->blkno > 0) {
336 363 : error = xfs_da3_node_read(context->tp, dp, cursor->blkno, &bp,
337 : XFS_ATTR_FORK);
338 363 : if (xfs_metadata_is_sick(error))
339 0 : xfs_dirattr_mark_sick(dp, XFS_ATTR_FORK);
340 363 : if ((error != 0) && (error != -EFSCORRUPTED))
341 : return error;
342 363 : if (bp) {
343 363 : struct xfs_attr_leaf_entry *entries;
344 :
345 363 : node = bp->b_addr;
346 363 : switch (be16_to_cpu(node->hdr.info.magic)) {
347 0 : case XFS_DA_NODE_MAGIC:
348 : case XFS_DA3_NODE_MAGIC:
349 0 : trace_xfs_attr_list_wrong_blk(context);
350 0 : fa = xfs_da3_node_header_check(bp,
351 : dp->i_ino);
352 0 : if (fa) {
353 0 : __xfs_buf_mark_corrupt(bp, fa);
354 0 : xfs_dirattr_mark_sick(dp, XFS_ATTR_FORK);
355 : }
356 0 : xfs_trans_brelse(context->tp, bp);
357 0 : bp = NULL;
358 0 : break;
359 363 : case XFS_ATTR_LEAF_MAGIC:
360 : case XFS_ATTR3_LEAF_MAGIC:
361 363 : leaf = bp->b_addr;
362 363 : fa = xfs_attr3_leaf_header_check(bp,
363 : dp->i_ino);
364 363 : if (fa) {
365 0 : __xfs_buf_mark_corrupt(bp, fa);
366 0 : xfs_trans_brelse(context->tp, bp);
367 0 : xfs_dirattr_mark_sick(dp, XFS_ATTR_FORK);
368 0 : bp = NULL;
369 0 : break;
370 : }
371 363 : xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo,
372 : &leafhdr, leaf);
373 363 : entries = xfs_attr3_leaf_entryp(leaf);
374 726 : if (cursor->hashval > be32_to_cpu(
375 : entries[leafhdr.count - 1].hashval)) {
376 0 : trace_xfs_attr_list_wrong_blk(context);
377 0 : xfs_trans_brelse(context->tp, bp);
378 0 : bp = NULL;
379 726 : } else if (cursor->hashval <= be32_to_cpu(
380 : entries[0].hashval)) {
381 325 : trace_xfs_attr_list_wrong_blk(context);
382 325 : xfs_trans_brelse(context->tp, bp);
383 325 : bp = NULL;
384 : }
385 : break;
386 0 : default:
387 0 : trace_xfs_attr_list_wrong_blk(context);
388 0 : xfs_trans_brelse(context->tp, bp);
389 0 : bp = NULL;
390 : }
391 : }
392 : }
393 :
394 : /*
395 : * We did not find what we expected given the cursor's contents,
396 : * so we start from the top and work down based on the hash value.
397 : * Note that start of node block is same as start of leaf block.
398 : */
399 973679 : if (bp == NULL) {
400 973638 : error = xfs_attr_node_list_lookup(context, cursor, &bp);
401 973626 : if (error || !bp)
402 : return error;
403 : }
404 973667 : ASSERT(bp != NULL);
405 :
406 : /*
407 : * Roll upward through the blocks, processing each leaf block in
408 : * order. As long as there is space in the result buffer, keep
409 : * adding the information.
410 : */
411 307071296 : for (;;) {
412 307071296 : leaf = bp->b_addr;
413 307071296 : error = xfs_attr3_leaf_list_int(bp, context);
414 307071045 : if (error)
415 : break;
416 307071045 : xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &leafhdr, leaf);
417 307071210 : if (context->seen_enough || leafhdr.forw == 0)
418 : break;
419 306097537 : cursor->blkno = leafhdr.forw;
420 306097537 : xfs_trans_brelse(context->tp, bp);
421 306097626 : error = xfs_attr3_leaf_read(context->tp, dp, dp->i_ino,
422 : cursor->blkno, &bp);
423 306097629 : if (error)
424 0 : return error;
425 : }
426 973673 : xfs_trans_brelse(context->tp, bp);
427 973673 : return error;
428 : }
429 :
430 : /*
431 : * Copy out attribute list entries for attr_list(), for leaf attribute lists.
432 : */
433 : int
434 350949408 : xfs_attr3_leaf_list_int(
435 : struct xfs_buf *bp,
436 : struct xfs_attr_list_context *context)
437 : {
438 350949408 : struct xfs_attrlist_cursor_kern *cursor = &context->cursor;
439 350949408 : struct xfs_attr_leafblock *leaf;
440 350949408 : struct xfs_attr3_icleaf_hdr ichdr;
441 350949408 : struct xfs_attr_leaf_entry *entries;
442 350949408 : struct xfs_attr_leaf_entry *entry;
443 350949408 : int i;
444 350949408 : struct xfs_mount *mp = context->dp->i_mount;
445 :
446 350949408 : trace_xfs_attr_list_leaf(context);
447 :
448 350949704 : leaf = bp->b_addr;
449 350949704 : xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);
450 350956616 : entries = xfs_attr3_leaf_entryp(leaf);
451 :
452 350956616 : cursor->initted = 1;
453 :
454 : /*
455 : * Re-find our place in the leaf block if this is a new syscall.
456 : */
457 350956616 : if (context->resynch) {
458 : entry = &entries[0];
459 54553702 : for (i = 0; i < ichdr.count; entry++, i++) {
460 107903686 : if (be32_to_cpu(entry->hashval) == cursor->hashval) {
461 9091265 : if (cursor->offset == context->dupcnt) {
462 365 : context->dupcnt = 0;
463 365 : break;
464 : }
465 9090900 : context->dupcnt++;
466 44860578 : } else if (be32_to_cpu(entry->hashval) >
467 : cursor->hashval) {
468 44860274 : context->dupcnt = 0;
469 44860274 : break;
470 : }
471 : }
472 45462498 : if (i == ichdr.count) {
473 601859 : trace_xfs_attr_list_notfound(context);
474 601859 : return 0;
475 : }
476 : } else {
477 : entry = &entries[0];
478 : i = 0;
479 : }
480 350354757 : context->resynch = 0;
481 :
482 : /*
483 : * We have found our place, start copying out the new attributes.
484 : */
485 6142843791 : for (; i < ichdr.count; entry++, i++) {
486 5792486401 : char *name;
487 5792486401 : void *value;
488 5792486401 : int namelen, valuelen;
489 :
490 11584972802 : if (be32_to_cpu(entry->hashval) != cursor->hashval) {
491 1235823483 : cursor->hashval = be32_to_cpu(entry->hashval);
492 1235823483 : cursor->offset = 0;
493 : }
494 :
495 5792486401 : if ((entry->flags & XFS_ATTR_INCOMPLETE) &&
496 0 : !context->allow_incomplete)
497 0 : continue;
498 :
499 5792486401 : if (entry->flags & XFS_ATTR_LOCAL) {
500 5792486179 : xfs_attr_leaf_name_local_t *name_loc;
501 :
502 5792486179 : name_loc = xfs_attr3_leaf_name_local(leaf, i);
503 5792486179 : name = name_loc->nameval;
504 5792486179 : namelen = name_loc->namelen;
505 5792486179 : value = &name_loc->nameval[name_loc->namelen];
506 5792486179 : valuelen = be16_to_cpu(name_loc->valuelen);
507 : } else {
508 222 : xfs_attr_leaf_name_remote_t *name_rmt;
509 :
510 222 : name_rmt = xfs_attr3_leaf_name_remote(leaf, i);
511 222 : name = name_rmt->name;
512 222 : namelen = name_rmt->namelen;
513 222 : value = NULL;
514 222 : valuelen = be32_to_cpu(name_rmt->valuelen);
515 : }
516 :
517 5792486401 : if (XFS_IS_CORRUPT(context->dp->i_mount,
518 : !xfs_attr_namecheck(mp, name, namelen,
519 : entry->flags))) {
520 0 : xfs_dirattr_mark_sick(context->dp, XFS_ATTR_FORK);
521 0 : return -EFSCORRUPTED;
522 : }
523 5798581948 : context->put_listent(context, entry->flags,
524 : name, namelen, value, valuelen);
525 5792489403 : if (context->seen_enough)
526 : break;
527 5792489034 : cursor->offset++;
528 : }
529 350357759 : trace_xfs_attr_list_leaf_end(context);
530 350357759 : return 0;
531 : }
532 :
533 : /*
534 : * Copy out attribute entries for attr_list(), for leaf attribute lists.
535 : */
536 : STATIC int
537 43889270 : xfs_attr_leaf_list(
538 : struct xfs_attr_list_context *context)
539 : {
540 43889270 : struct xfs_buf *bp;
541 43889270 : int error;
542 :
543 43889270 : trace_xfs_attr_leaf_list(context);
544 :
545 43890506 : context->cursor.blkno = 0;
546 43890506 : error = xfs_attr3_leaf_read(context->tp, context->dp,
547 : context->dp->i_ino, 0, &bp);
548 43878995 : if (error)
549 : return error;
550 :
551 43878568 : error = xfs_attr3_leaf_list_int(bp, context);
552 43888937 : xfs_trans_brelse(context->tp, bp);
553 43888937 : return error;
554 : }
555 :
556 : int
557 472522089 : xfs_attr_list_ilocked(
558 : struct xfs_attr_list_context *context)
559 : {
560 472522089 : struct xfs_inode *dp = context->dp;
561 :
562 472522089 : ASSERT(xfs_isilocked(dp, XFS_ILOCK_SHARED | XFS_ILOCK_EXCL));
563 :
564 : /*
565 : * Decide on what work routines to call based on the inode size.
566 : */
567 472533127 : if (!xfs_inode_hasattr(dp))
568 : return 0;
569 450189346 : if (dp->i_af.if_format == XFS_DINODE_FMT_LOCAL)
570 405322708 : return xfs_attr_shortform_list(context);
571 44866638 : if (xfs_attr_is_leaf(dp))
572 43890471 : return xfs_attr_leaf_list(context);
573 973672 : return xfs_attr_node_list(context);
574 : }
575 :
576 : int
577 472457158 : xfs_attr_list(
578 : struct xfs_attr_list_context *context)
579 : {
580 472457158 : struct xfs_inode *dp = context->dp;
581 472457158 : uint lock_mode;
582 472457158 : int error;
583 :
584 472457158 : XFS_STATS_INC(dp->i_mount, xs_attr_list);
585 :
586 944914316 : if (xfs_is_shutdown(dp->i_mount))
587 : return -EIO;
588 :
589 472457157 : lock_mode = xfs_ilock_attr_map_shared(dp);
590 472536761 : error = xfs_attr_list_ilocked(context);
591 472483723 : xfs_iunlock(dp, lock_mode);
592 472483723 : return error;
593 : }
|