[PATCH] Check return value of xfs_buf_get_noaddr()

Lachlan McIlroy lachlan at sgi.com
Wed Dec 3 23:39:29 CST 2008


We check the return value of all other calls to xfs_buf_get_noaddr().
Make sense to do it here too.

--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -3034,6 +3034,8 @@ xfs_zero_remaining_bytes(
  	bp = xfs_buf_get_noaddr(mp->m_sb.sb_blocksize,
  				XFS_IS_REALTIME_INODE(ip) ?
  				mp->m_rtdev_targp : mp->m_ddev_targp);
+	if (!bp)
+		return ENOMEM;

  	for (offset = startoff; offset <= endoff; offset = lastoffset + 1) {
  		offset_fsb = XFS_B_TO_FSBT(mp, offset);




More information about the xfs mailing list