diff options
Diffstat (limited to 'fs/xfs/xfs_iomap.c')
-rw-r--r-- | fs/xfs/xfs_iomap.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 55582bd66659..091d82b94c4d 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c | |||
@@ -101,11 +101,11 @@ xfs_iomap_eof_align_last_fsb( | |||
101 | } | 101 | } |
102 | 102 | ||
103 | STATIC int | 103 | STATIC int |
104 | xfs_cmn_err_fsblock_zero( | 104 | xfs_alert_fsblock_zero( |
105 | xfs_inode_t *ip, | 105 | xfs_inode_t *ip, |
106 | xfs_bmbt_irec_t *imap) | 106 | xfs_bmbt_irec_t *imap) |
107 | { | 107 | { |
108 | xfs_cmn_err(XFS_PTAG_FSBLOCK_ZERO, CE_ALERT, ip->i_mount, | 108 | xfs_alert_tag(ip->i_mount, XFS_PTAG_FSBLOCK_ZERO, |
109 | "Access to block zero in inode %llu " | 109 | "Access to block zero in inode %llu " |
110 | "start_block: %llx start_off: %llx " | 110 | "start_block: %llx start_off: %llx " |
111 | "blkcnt: %llx extent-state: %x\n", | 111 | "blkcnt: %llx extent-state: %x\n", |
@@ -246,7 +246,7 @@ xfs_iomap_write_direct( | |||
246 | } | 246 | } |
247 | 247 | ||
248 | if (!(imap->br_startblock || XFS_IS_REALTIME_INODE(ip))) { | 248 | if (!(imap->br_startblock || XFS_IS_REALTIME_INODE(ip))) { |
249 | error = xfs_cmn_err_fsblock_zero(ip, imap); | 249 | error = xfs_alert_fsblock_zero(ip, imap); |
250 | goto error_out; | 250 | goto error_out; |
251 | } | 251 | } |
252 | 252 | ||
@@ -337,7 +337,12 @@ xfs_iomap_prealloc_size( | |||
337 | int shift = 0; | 337 | int shift = 0; |
338 | int64_t freesp; | 338 | int64_t freesp; |
339 | 339 | ||
340 | alloc_blocks = XFS_B_TO_FSB(mp, ip->i_size); | 340 | /* |
341 | * rounddown_pow_of_two() returns an undefined result | ||
342 | * if we pass in alloc_blocks = 0. Hence the "+ 1" to | ||
343 | * ensure we always pass in a non-zero value. | ||
344 | */ | ||
345 | alloc_blocks = XFS_B_TO_FSB(mp, ip->i_size) + 1; | ||
341 | alloc_blocks = XFS_FILEOFF_MIN(MAXEXTLEN, | 346 | alloc_blocks = XFS_FILEOFF_MIN(MAXEXTLEN, |
342 | rounddown_pow_of_two(alloc_blocks)); | 347 | rounddown_pow_of_two(alloc_blocks)); |
343 | 348 | ||
@@ -459,7 +464,7 @@ retry: | |||
459 | } | 464 | } |
460 | 465 | ||
461 | if (!(imap[0].br_startblock || XFS_IS_REALTIME_INODE(ip))) | 466 | if (!(imap[0].br_startblock || XFS_IS_REALTIME_INODE(ip))) |
462 | return xfs_cmn_err_fsblock_zero(ip, &imap[0]); | 467 | return xfs_alert_fsblock_zero(ip, &imap[0]); |
463 | 468 | ||
464 | *ret_imap = imap[0]; | 469 | *ret_imap = imap[0]; |
465 | return 0; | 470 | return 0; |
@@ -609,7 +614,7 @@ xfs_iomap_write_allocate( | |||
609 | * covers at least part of the callers request | 614 | * covers at least part of the callers request |
610 | */ | 615 | */ |
611 | if (!(imap->br_startblock || XFS_IS_REALTIME_INODE(ip))) | 616 | if (!(imap->br_startblock || XFS_IS_REALTIME_INODE(ip))) |
612 | return xfs_cmn_err_fsblock_zero(ip, imap); | 617 | return xfs_alert_fsblock_zero(ip, imap); |
613 | 618 | ||
614 | if ((offset_fsb >= imap->br_startoff) && | 619 | if ((offset_fsb >= imap->br_startoff) && |
615 | (offset_fsb < (imap->br_startoff + | 620 | (offset_fsb < (imap->br_startoff + |
@@ -719,7 +724,7 @@ xfs_iomap_write_unwritten( | |||
719 | return XFS_ERROR(error); | 724 | return XFS_ERROR(error); |
720 | 725 | ||
721 | if (!(imap.br_startblock || XFS_IS_REALTIME_INODE(ip))) | 726 | if (!(imap.br_startblock || XFS_IS_REALTIME_INODE(ip))) |
722 | return xfs_cmn_err_fsblock_zero(ip, &imap); | 727 | return xfs_alert_fsblock_zero(ip, &imap); |
723 | 728 | ||
724 | if ((numblks_fsb = imap.br_blockcount) == 0) { | 729 | if ((numblks_fsb = imap.br_blockcount) == 0) { |
725 | /* | 730 | /* |