Skip to contentSkip to conversation

Check return value of xfs_buf_get_noaddr()

PATCH In review Lachlan McIlroy 3 participants 4 messages Dec 4, 2008 – Dec 5, 2008 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Check return value of xfs_buf_get_noaddr()

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

fs/xfs/xfs_vnodeops.c +2 -0
@@ -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);

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw
In reply to Lachlan McIlroy

fs/xfs/xfs_vnodeops.c xfs_zero_remaining_bytes( · line 3038

Quoted 11 lines · Lachlan McIlroy

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

fs/xfs/xfs_vnodeops.c +2 -0
@@ -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;

Maybe

+ return XFS_ERROR(ENOMEM);

-Eric

Quoted 8 lines
fs/xfs/xfs_vnodeops.c +0 -0
  	for (offset = startoff; offset <= endoff; offset = lastoffset + 1) {
  		offset_fsb = XFS_B_TO_FSBT(mp, offset);
 

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw
Quoted 15 lines · Eric Sandeen

fs/xfs/xfs_vnodeops.c xfs_zero_remaining_bytes( · line 3038

Quoted 11 lines · Lachlan McIlroy

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

fs/xfs/xfs_vnodeops.c +2 -0
@@ -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;

Maybe

Review

Quoted 1 line
(quoted diff) +1 -0
+		return XFS_ERROR(ENOMEM);

Okay. Will do.

Quoted 13 lines

-Eric

Quoted 8 lines
fs/xfs/xfs_vnodeops.c +0 -0
  	for (offset = startoff; offset <= endoff; offset = lastoffset + 1) {
  		offset_fsb = XFS_B_TO_FSBT(mp, offset);
 

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs