]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - fs/xfs/scrub/inode.c
xfs: check btree block ownership with bnobt/rmapbt when scrubbing btree
[mirror_ubuntu-jammy-kernel.git] / fs / xfs / scrub / inode.c
CommitLineData
80e4e126
DW
1/*
2 * Copyright (C) 2017 Oracle. All Rights Reserved.
3 *
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it would be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20#include "xfs.h"
21#include "xfs_fs.h"
22#include "xfs_shared.h"
23#include "xfs_format.h"
24#include "xfs_trans_resv.h"
25#include "xfs_mount.h"
26#include "xfs_defer.h"
27#include "xfs_btree.h"
28#include "xfs_bit.h"
29#include "xfs_log_format.h"
30#include "xfs_trans.h"
31#include "xfs_sb.h"
32#include "xfs_inode.h"
33#include "xfs_icache.h"
34#include "xfs_inode_buf.h"
35#include "xfs_inode_fork.h"
36#include "xfs_ialloc.h"
37#include "xfs_da_format.h"
38#include "xfs_reflink.h"
39#include "scrub/xfs_scrub.h"
40#include "scrub/scrub.h"
41#include "scrub/common.h"
42#include "scrub/trace.h"
43
44/*
45 * Grab total control of the inode metadata. It doesn't matter here if
46 * the file data is still changing; exclusive access to the metadata is
47 * the goal.
48 */
49int
50xfs_scrub_setup_inode(
51 struct xfs_scrub_context *sc,
52 struct xfs_inode *ip)
53{
54 struct xfs_mount *mp = sc->mp;
55 int error;
56
57 /*
58 * Try to get the inode. If the verifiers fail, we try again
59 * in raw mode.
60 */
61 error = xfs_scrub_get_inode(sc, ip);
62 switch (error) {
63 case 0:
64 break;
65 case -EFSCORRUPTED:
66 case -EFSBADCRC:
1ad1205e 67 return xfs_scrub_trans_alloc(sc->sm, mp, &sc->tp);
80e4e126
DW
68 default:
69 return error;
70 }
71
72 /* Got the inode, lock it and we're ready to go. */
73 sc->ilock_flags = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL;
74 xfs_ilock(sc->ip, sc->ilock_flags);
75 error = xfs_scrub_trans_alloc(sc->sm, mp, &sc->tp);
76 if (error)
77 goto out;
78 sc->ilock_flags |= XFS_ILOCK_EXCL;
79 xfs_ilock(sc->ip, XFS_ILOCK_EXCL);
80
81out:
82 /* scrub teardown will unlock and release the inode for us */
83 return error;
84}
85
86/* Inode core */
87
88/*
89 * Validate di_extsize hint.
90 *
91 * The rules are documented at xfs_ioctl_setattr_check_extsize().
92 * These functions must be kept in sync with each other.
93 */
94STATIC void
95xfs_scrub_inode_extsize(
96 struct xfs_scrub_context *sc,
97 struct xfs_buf *bp,
98 struct xfs_dinode *dip,
99 xfs_ino_t ino,
100 uint16_t mode,
101 uint16_t flags)
102{
103 struct xfs_mount *mp = sc->mp;
104 bool rt_flag;
105 bool hint_flag;
106 bool inherit_flag;
107 uint32_t extsize;
108 uint32_t extsize_bytes;
109 uint32_t blocksize_bytes;
110
111 rt_flag = (flags & XFS_DIFLAG_REALTIME);
112 hint_flag = (flags & XFS_DIFLAG_EXTSIZE);
113 inherit_flag = (flags & XFS_DIFLAG_EXTSZINHERIT);
114 extsize = be32_to_cpu(dip->di_extsize);
115 extsize_bytes = XFS_FSB_TO_B(sc->mp, extsize);
116
117 if (rt_flag)
118 blocksize_bytes = mp->m_sb.sb_rextsize << mp->m_sb.sb_blocklog;
119 else
120 blocksize_bytes = mp->m_sb.sb_blocksize;
121
122 if ((hint_flag || inherit_flag) && !(S_ISDIR(mode) || S_ISREG(mode)))
123 goto bad;
124
125 if (hint_flag && !S_ISREG(mode))
126 goto bad;
127
128 if (inherit_flag && !S_ISDIR(mode))
129 goto bad;
130
131 if ((hint_flag || inherit_flag) && extsize == 0)
132 goto bad;
133
134 if (!(hint_flag || inherit_flag) && extsize != 0)
135 goto bad;
136
137 if (extsize_bytes % blocksize_bytes)
138 goto bad;
139
140 if (extsize > MAXEXTLEN)
141 goto bad;
142
143 if (!rt_flag && extsize > mp->m_sb.sb_agblocks / 2)
144 goto bad;
145
146 return;
147bad:
148 xfs_scrub_ino_set_corrupt(sc, ino, bp);
149}
150
151/*
152 * Validate di_cowextsize hint.
153 *
154 * The rules are documented at xfs_ioctl_setattr_check_cowextsize().
155 * These functions must be kept in sync with each other.
156 */
157STATIC void
158xfs_scrub_inode_cowextsize(
159 struct xfs_scrub_context *sc,
160 struct xfs_buf *bp,
161 struct xfs_dinode *dip,
162 xfs_ino_t ino,
163 uint16_t mode,
164 uint16_t flags,
165 uint64_t flags2)
166{
167 struct xfs_mount *mp = sc->mp;
168 bool rt_flag;
169 bool hint_flag;
170 uint32_t extsize;
171 uint32_t extsize_bytes;
172
173 rt_flag = (flags & XFS_DIFLAG_REALTIME);
174 hint_flag = (flags2 & XFS_DIFLAG2_COWEXTSIZE);
175 extsize = be32_to_cpu(dip->di_cowextsize);
176 extsize_bytes = XFS_FSB_TO_B(sc->mp, extsize);
177
178 if (hint_flag && !xfs_sb_version_hasreflink(&mp->m_sb))
179 goto bad;
180
181 if (hint_flag && !(S_ISDIR(mode) || S_ISREG(mode)))
182 goto bad;
183
184 if (hint_flag && extsize == 0)
185 goto bad;
186
187 if (!hint_flag && extsize != 0)
188 goto bad;
189
190 if (hint_flag && rt_flag)
191 goto bad;
192
193 if (extsize_bytes % mp->m_sb.sb_blocksize)
194 goto bad;
195
196 if (extsize > MAXEXTLEN)
197 goto bad;
198
199 if (extsize > mp->m_sb.sb_agblocks / 2)
200 goto bad;
201
202 return;
203bad:
204 xfs_scrub_ino_set_corrupt(sc, ino, bp);
205}
206
207/* Make sure the di_flags make sense for the inode. */
208STATIC void
209xfs_scrub_inode_flags(
210 struct xfs_scrub_context *sc,
211 struct xfs_buf *bp,
212 struct xfs_dinode *dip,
213 xfs_ino_t ino,
214 uint16_t mode,
215 uint16_t flags)
216{
217 struct xfs_mount *mp = sc->mp;
218
219 if (flags & ~XFS_DIFLAG_ANY)
220 goto bad;
221
222 /* rt flags require rt device */
223 if ((flags & (XFS_DIFLAG_REALTIME | XFS_DIFLAG_RTINHERIT)) &&
224 !mp->m_rtdev_targp)
225 goto bad;
226
227 /* new rt bitmap flag only valid for rbmino */
228 if ((flags & XFS_DIFLAG_NEWRTBM) && ino != mp->m_sb.sb_rbmino)
229 goto bad;
230
231 /* directory-only flags */
232 if ((flags & (XFS_DIFLAG_RTINHERIT |
233 XFS_DIFLAG_EXTSZINHERIT |
234 XFS_DIFLAG_PROJINHERIT |
235 XFS_DIFLAG_NOSYMLINKS)) &&
236 !S_ISDIR(mode))
237 goto bad;
238
239 /* file-only flags */
240 if ((flags & (XFS_DIFLAG_REALTIME | FS_XFLAG_EXTSIZE)) &&
241 !S_ISREG(mode))
242 goto bad;
243
244 /* filestreams and rt make no sense */
245 if ((flags & XFS_DIFLAG_FILESTREAM) && (flags & XFS_DIFLAG_REALTIME))
246 goto bad;
247
248 return;
249bad:
250 xfs_scrub_ino_set_corrupt(sc, ino, bp);
251}
252
253/* Make sure the di_flags2 make sense for the inode. */
254STATIC void
255xfs_scrub_inode_flags2(
256 struct xfs_scrub_context *sc,
257 struct xfs_buf *bp,
258 struct xfs_dinode *dip,
259 xfs_ino_t ino,
260 uint16_t mode,
261 uint16_t flags,
262 uint64_t flags2)
263{
264 struct xfs_mount *mp = sc->mp;
265
266 if (flags2 & ~XFS_DIFLAG2_ANY)
267 goto bad;
268
269 /* reflink flag requires reflink feature */
270 if ((flags2 & XFS_DIFLAG2_REFLINK) &&
271 !xfs_sb_version_hasreflink(&mp->m_sb))
272 goto bad;
273
274 /* cowextsize flag is checked w.r.t. mode separately */
275
276 /* file/dir-only flags */
277 if ((flags2 & XFS_DIFLAG2_DAX) && !(S_ISREG(mode) || S_ISDIR(mode)))
278 goto bad;
279
280 /* file-only flags */
281 if ((flags2 & XFS_DIFLAG2_REFLINK) && !S_ISREG(mode))
282 goto bad;
283
284 /* realtime and reflink make no sense, currently */
285 if ((flags & XFS_DIFLAG_REALTIME) && (flags2 & XFS_DIFLAG2_REFLINK))
286 goto bad;
287
288 /* dax and reflink make no sense, currently */
289 if ((flags2 & XFS_DIFLAG2_DAX) && (flags2 & XFS_DIFLAG2_REFLINK))
290 goto bad;
291
292 return;
293bad:
294 xfs_scrub_ino_set_corrupt(sc, ino, bp);
295}
296
297/* Scrub all the ondisk inode fields. */
298STATIC void
299xfs_scrub_dinode(
300 struct xfs_scrub_context *sc,
301 struct xfs_buf *bp,
302 struct xfs_dinode *dip,
303 xfs_ino_t ino)
304{
305 struct xfs_mount *mp = sc->mp;
306 size_t fork_recs;
307 unsigned long long isize;
308 uint64_t flags2;
309 uint32_t nextents;
310 uint16_t flags;
311 uint16_t mode;
312
313 flags = be16_to_cpu(dip->di_flags);
314 if (dip->di_version >= 3)
315 flags2 = be64_to_cpu(dip->di_flags2);
316 else
317 flags2 = 0;
318
319 /* di_mode */
320 mode = be16_to_cpu(dip->di_mode);
3b42d385
DW
321 switch (mode & S_IFMT) {
322 case S_IFLNK:
323 case S_IFREG:
324 case S_IFDIR:
325 case S_IFCHR:
326 case S_IFBLK:
327 case S_IFIFO:
328 case S_IFSOCK:
329 /* mode is recognized */
330 break;
331 default:
80e4e126 332 xfs_scrub_ino_set_corrupt(sc, ino, bp);
3b42d385
DW
333 break;
334 }
80e4e126
DW
335
336 /* v1/v2 fields */
337 switch (dip->di_version) {
338 case 1:
339 /*
340 * We autoconvert v1 inodes into v2 inodes on writeout,
341 * so just mark this inode for preening.
342 */
0a1e1567 343 xfs_scrub_ino_set_preen(sc, ino, bp);
80e4e126
DW
344 break;
345 case 2:
346 case 3:
347 if (dip->di_onlink != 0)
348 xfs_scrub_ino_set_corrupt(sc, ino, bp);
349
350 if (dip->di_mode == 0 && sc->ip)
351 xfs_scrub_ino_set_corrupt(sc, ino, bp);
352
353 if (dip->di_projid_hi != 0 &&
354 !xfs_sb_version_hasprojid32bit(&mp->m_sb))
355 xfs_scrub_ino_set_corrupt(sc, ino, bp);
356 break;
357 default:
358 xfs_scrub_ino_set_corrupt(sc, ino, bp);
359 return;
360 }
361
362 /*
363 * di_uid/di_gid -- -1 isn't invalid, but there's no way that
364 * userspace could have created that.
365 */
366 if (dip->di_uid == cpu_to_be32(-1U) ||
367 dip->di_gid == cpu_to_be32(-1U))
0a1e1567 368 xfs_scrub_ino_set_warning(sc, ino, bp);
80e4e126
DW
369
370 /* di_format */
371 switch (dip->di_format) {
372 case XFS_DINODE_FMT_DEV:
373 if (!S_ISCHR(mode) && !S_ISBLK(mode) &&
374 !S_ISFIFO(mode) && !S_ISSOCK(mode))
375 xfs_scrub_ino_set_corrupt(sc, ino, bp);
376 break;
377 case XFS_DINODE_FMT_LOCAL:
378 if (!S_ISDIR(mode) && !S_ISLNK(mode))
379 xfs_scrub_ino_set_corrupt(sc, ino, bp);
380 break;
381 case XFS_DINODE_FMT_EXTENTS:
382 if (!S_ISREG(mode) && !S_ISDIR(mode) && !S_ISLNK(mode))
383 xfs_scrub_ino_set_corrupt(sc, ino, bp);
384 break;
385 case XFS_DINODE_FMT_BTREE:
386 if (!S_ISREG(mode) && !S_ISDIR(mode))
387 xfs_scrub_ino_set_corrupt(sc, ino, bp);
388 break;
389 case XFS_DINODE_FMT_UUID:
390 default:
391 xfs_scrub_ino_set_corrupt(sc, ino, bp);
392 break;
393 }
394
29c1c123
DW
395 /* di_[amc]time.nsec */
396 if (be32_to_cpu(dip->di_atime.t_nsec) >= NSEC_PER_SEC)
397 xfs_scrub_ino_set_corrupt(sc, ino, bp);
398 if (be32_to_cpu(dip->di_mtime.t_nsec) >= NSEC_PER_SEC)
399 xfs_scrub_ino_set_corrupt(sc, ino, bp);
400 if (be32_to_cpu(dip->di_ctime.t_nsec) >= NSEC_PER_SEC)
401 xfs_scrub_ino_set_corrupt(sc, ino, bp);
402
80e4e126
DW
403 /*
404 * di_size. xfs_dinode_verify checks for things that screw up
405 * the VFS such as the upper bit being set and zero-length
406 * symlinks/directories, but we can do more here.
407 */
408 isize = be64_to_cpu(dip->di_size);
409 if (isize & (1ULL << 63))
410 xfs_scrub_ino_set_corrupt(sc, ino, bp);
411
412 /* Devices, fifos, and sockets must have zero size */
413 if (!S_ISDIR(mode) && !S_ISREG(mode) && !S_ISLNK(mode) && isize != 0)
414 xfs_scrub_ino_set_corrupt(sc, ino, bp);
415
416 /* Directories can't be larger than the data section size (32G) */
417 if (S_ISDIR(mode) && (isize == 0 || isize >= XFS_DIR2_SPACE_SIZE))
418 xfs_scrub_ino_set_corrupt(sc, ino, bp);
419
420 /* Symlinks can't be larger than SYMLINK_MAXLEN */
421 if (S_ISLNK(mode) && (isize == 0 || isize >= XFS_SYMLINK_MAXLEN))
422 xfs_scrub_ino_set_corrupt(sc, ino, bp);
423
424 /*
425 * Warn if the running kernel can't handle the kinds of offsets
426 * needed to deal with the file size. In other words, if the
427 * pagecache can't cache all the blocks in this file due to
428 * overly large offsets, flag the inode for admin review.
429 */
430 if (isize >= mp->m_super->s_maxbytes)
0a1e1567 431 xfs_scrub_ino_set_warning(sc, ino, bp);
80e4e126
DW
432
433 /* di_nblocks */
434 if (flags2 & XFS_DIFLAG2_REFLINK) {
435 ; /* nblocks can exceed dblocks */
436 } else if (flags & XFS_DIFLAG_REALTIME) {
437 /*
438 * nblocks is the sum of data extents (in the rtdev),
439 * attr extents (in the datadev), and both forks' bmbt
440 * blocks (in the datadev). This clumsy check is the
441 * best we can do without cross-referencing with the
442 * inode forks.
443 */
444 if (be64_to_cpu(dip->di_nblocks) >=
445 mp->m_sb.sb_dblocks + mp->m_sb.sb_rblocks)
446 xfs_scrub_ino_set_corrupt(sc, ino, bp);
447 } else {
448 if (be64_to_cpu(dip->di_nblocks) >= mp->m_sb.sb_dblocks)
449 xfs_scrub_ino_set_corrupt(sc, ino, bp);
450 }
451
452 xfs_scrub_inode_flags(sc, bp, dip, ino, mode, flags);
453
454 xfs_scrub_inode_extsize(sc, bp, dip, ino, mode, flags);
455
456 /* di_nextents */
457 nextents = be32_to_cpu(dip->di_nextents);
458 fork_recs = XFS_DFORK_DSIZE(dip, mp) / sizeof(struct xfs_bmbt_rec);
459 switch (dip->di_format) {
460 case XFS_DINODE_FMT_EXTENTS:
461 if (nextents > fork_recs)
462 xfs_scrub_ino_set_corrupt(sc, ino, bp);
463 break;
464 case XFS_DINODE_FMT_BTREE:
465 if (nextents <= fork_recs)
466 xfs_scrub_ino_set_corrupt(sc, ino, bp);
467 break;
468 default:
469 if (nextents != 0)
470 xfs_scrub_ino_set_corrupt(sc, ino, bp);
471 break;
472 }
473
474 /* di_forkoff */
475 if (XFS_DFORK_APTR(dip) >= (char *)dip + mp->m_sb.sb_inodesize)
476 xfs_scrub_ino_set_corrupt(sc, ino, bp);
477 if (dip->di_anextents != 0 && dip->di_forkoff == 0)
478 xfs_scrub_ino_set_corrupt(sc, ino, bp);
479 if (dip->di_forkoff == 0 && dip->di_aformat != XFS_DINODE_FMT_EXTENTS)
480 xfs_scrub_ino_set_corrupt(sc, ino, bp);
481
482 /* di_aformat */
483 if (dip->di_aformat != XFS_DINODE_FMT_LOCAL &&
484 dip->di_aformat != XFS_DINODE_FMT_EXTENTS &&
485 dip->di_aformat != XFS_DINODE_FMT_BTREE)
486 xfs_scrub_ino_set_corrupt(sc, ino, bp);
487
488 /* di_anextents */
489 nextents = be16_to_cpu(dip->di_anextents);
490 fork_recs = XFS_DFORK_ASIZE(dip, mp) / sizeof(struct xfs_bmbt_rec);
491 switch (dip->di_aformat) {
492 case XFS_DINODE_FMT_EXTENTS:
493 if (nextents > fork_recs)
494 xfs_scrub_ino_set_corrupt(sc, ino, bp);
495 break;
496 case XFS_DINODE_FMT_BTREE:
497 if (nextents <= fork_recs)
498 xfs_scrub_ino_set_corrupt(sc, ino, bp);
499 break;
500 default:
501 if (nextents != 0)
502 xfs_scrub_ino_set_corrupt(sc, ino, bp);
503 }
504
505 if (dip->di_version >= 3) {
29c1c123
DW
506 if (be32_to_cpu(dip->di_crtime.t_nsec) >= NSEC_PER_SEC)
507 xfs_scrub_ino_set_corrupt(sc, ino, bp);
80e4e126
DW
508 xfs_scrub_inode_flags2(sc, bp, dip, ino, mode, flags, flags2);
509 xfs_scrub_inode_cowextsize(sc, bp, dip, ino, mode, flags,
510 flags2);
511 }
512}
513
514/* Map and read a raw inode. */
515STATIC int
516xfs_scrub_inode_map_raw(
517 struct xfs_scrub_context *sc,
518 xfs_ino_t ino,
519 struct xfs_buf **bpp,
520 struct xfs_dinode **dipp)
521{
522 struct xfs_imap imap;
523 struct xfs_mount *mp = sc->mp;
524 struct xfs_buf *bp = NULL;
525 struct xfs_dinode *dip;
526 int error;
527
528 error = xfs_imap(mp, sc->tp, ino, &imap, XFS_IGET_UNTRUSTED);
529 if (error == -EINVAL) {
530 /*
531 * Inode could have gotten deleted out from under us;
532 * just forget about it.
533 */
534 error = -ENOENT;
535 goto out;
536 }
537 if (!xfs_scrub_process_error(sc, XFS_INO_TO_AGNO(mp, ino),
538 XFS_INO_TO_AGBNO(mp, ino), &error))
539 goto out;
540
541 error = xfs_trans_read_buf(mp, sc->tp, mp->m_ddev_targp,
542 imap.im_blkno, imap.im_len, XBF_UNMAPPED, &bp,
543 NULL);
544 if (!xfs_scrub_process_error(sc, XFS_INO_TO_AGNO(mp, ino),
545 XFS_INO_TO_AGBNO(mp, ino), &error))
546 goto out;
547
548 /*
549 * Is this really an inode? We disabled verifiers in the above
550 * xfs_trans_read_buf call because the inode buffer verifier
551 * fails on /any/ inode record in the inode cluster with a bad
552 * magic or version number, not just the one that we're
553 * checking. Therefore, grab the buffer unconditionally, attach
554 * the inode verifiers by hand, and run the inode verifier only
555 * on the one inode we want.
556 */
557 bp->b_ops = &xfs_inode_buf_ops;
558 dip = xfs_buf_offset(bp, imap.im_boffset);
a6a781a5 559 if (xfs_dinode_verify(mp, ino, dip) != NULL ||
80e4e126
DW
560 !xfs_dinode_good_version(mp, dip->di_version)) {
561 xfs_scrub_ino_set_corrupt(sc, ino, bp);
562 goto out_buf;
563 }
564
565 /* ...and is it the one we asked for? */
566 if (be32_to_cpu(dip->di_gen) != sc->sm->sm_gen) {
567 error = -ENOENT;
568 goto out_buf;
569 }
570
571 *dipp = dip;
572 *bpp = bp;
573out:
574 return error;
575out_buf:
576 xfs_trans_brelse(sc->tp, bp);
577 return error;
578}
579
580/* Scrub an inode. */
581int
582xfs_scrub_inode(
583 struct xfs_scrub_context *sc)
584{
585 struct xfs_dinode di;
586 struct xfs_mount *mp = sc->mp;
587 struct xfs_buf *bp = NULL;
588 struct xfs_dinode *dip;
589 xfs_ino_t ino;
590
591 bool has_shared;
592 int error = 0;
593
594 /* Did we get the in-core inode, or are we doing this manually? */
595 if (sc->ip) {
596 ino = sc->ip->i_ino;
597 xfs_inode_to_disk(sc->ip, &di, 0);
598 dip = &di;
599 } else {
600 /* Map & read inode. */
601 ino = sc->sm->sm_ino;
602 error = xfs_scrub_inode_map_raw(sc, ino, &bp, &dip);
603 if (error || !bp)
604 goto out;
605 }
606
607 xfs_scrub_dinode(sc, bp, dip, ino);
608 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
609 goto out;
610
611 /* Now let's do the things that require a live inode. */
612 if (!sc->ip)
613 goto out;
614
615 /*
616 * Does this inode have the reflink flag set but no shared extents?
617 * Set the preening flag if this is the case.
618 */
619 if (xfs_is_reflink_inode(sc->ip)) {
620 error = xfs_reflink_inode_has_shared_extents(sc->tp, sc->ip,
621 &has_shared);
9a7e2695 622 if (!xfs_scrub_xref_process_error(sc, XFS_INO_TO_AGNO(mp, ino),
80e4e126
DW
623 XFS_INO_TO_AGBNO(mp, ino), &error))
624 goto out;
625 if (!has_shared)
0a1e1567 626 xfs_scrub_ino_set_preen(sc, ino, bp);
80e4e126
DW
627 }
628
629out:
630 if (bp)
631 xfs_trans_brelse(sc->tp, bp);
632 return error;
633}