提交 86c4d623 编写于 作者: D David Chinner 提交者: Lachlan McIlroy

[XFS] Fix check for block zero access in xfs_write_iomap_allocate()

The check for block zero access should be done on non-realtime inodes. Fix
the logic error in xfs_write_iomap_allocate(), and simplify the logic on
all checks for block zero access in xfs_iomap.c

SGI-PV: 980888
SGI-Modid: xfs-linux-melb:xfs-kern:30998a
Signed-off-by: NDavid Chinner <dgc@sgi.com>
Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
上级 d349404f
...@@ -523,8 +523,7 @@ xfs_iomap_write_direct( ...@@ -523,8 +523,7 @@ xfs_iomap_write_direct(
goto error_out; goto error_out;
} }
if (unlikely(!imap.br_startblock && if (!(imap.br_startblock || XFS_IS_REALTIME_INODE(ip))) {
!(XFS_IS_REALTIME_INODE(ip)))) {
error = xfs_cmn_err_fsblock_zero(ip, &imap); error = xfs_cmn_err_fsblock_zero(ip, &imap);
goto error_out; goto error_out;
} }
...@@ -686,8 +685,7 @@ xfs_iomap_write_delay( ...@@ -686,8 +685,7 @@ xfs_iomap_write_delay(
goto retry; goto retry;
} }
if (unlikely(!imap[0].br_startblock && if (!(imap[0].br_startblock || XFS_IS_REALTIME_INODE(ip)))
!(XFS_IS_REALTIME_INODE(ip))))
return xfs_cmn_err_fsblock_zero(ip, &imap[0]); return xfs_cmn_err_fsblock_zero(ip, &imap[0]);
*ret_imap = imap[0]; *ret_imap = imap[0];
...@@ -838,9 +836,9 @@ xfs_iomap_write_allocate( ...@@ -838,9 +836,9 @@ xfs_iomap_write_allocate(
* See if we were able to allocate an extent that * See if we were able to allocate an extent that
* covers at least part of the callers request * covers at least part of the callers request
*/ */
if (unlikely(!imap.br_startblock && if (!(imap.br_startblock || XFS_IS_REALTIME_INODE(ip)))
XFS_IS_REALTIME_INODE(ip)))
return xfs_cmn_err_fsblock_zero(ip, &imap); return xfs_cmn_err_fsblock_zero(ip, &imap);
if ((offset_fsb >= imap.br_startoff) && if ((offset_fsb >= imap.br_startoff) &&
(offset_fsb < (imap.br_startoff + (offset_fsb < (imap.br_startoff +
imap.br_blockcount))) { imap.br_blockcount))) {
...@@ -934,8 +932,7 @@ xfs_iomap_write_unwritten( ...@@ -934,8 +932,7 @@ xfs_iomap_write_unwritten(
if (error) if (error)
return XFS_ERROR(error); return XFS_ERROR(error);
if (unlikely(!imap.br_startblock && if (!(imap.br_startblock || XFS_IS_REALTIME_INODE(ip)))
!(XFS_IS_REALTIME_INODE(ip))))
return xfs_cmn_err_fsblock_zero(ip, &imap); return xfs_cmn_err_fsblock_zero(ip, &imap);
if ((numblks_fsb = imap.br_blockcount) == 0) { if ((numblks_fsb = imap.br_blockcount) == 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册