* [PATCH] Check return value of xfs_buf_get_noaddr()
@ 2008-12-04 5:39 Lachlan McIlroy
2008-12-04 7:09 ` Christoph Hellwig
2008-12-04 15:28 ` Eric Sandeen
0 siblings, 2 replies; 4+ messages in thread
From: Lachlan McIlroy @ 2008-12-04 5:39 UTC (permalink / raw)
To: xfs-oss
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);
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Check return value of xfs_buf_get_noaddr()
2008-12-04 5:39 [PATCH] Check return value of xfs_buf_get_noaddr() Lachlan McIlroy
@ 2008-12-04 7:09 ` Christoph Hellwig
2008-12-04 15:28 ` Eric Sandeen
1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2008-12-04 7:09 UTC (permalink / raw)
To: Lachlan McIlroy; +Cc: xfs-oss
On Thu, Dec 04, 2008 at 04:39:29PM +1100, Lachlan McIlroy wrote:
> We check the return value of all other calls to xfs_buf_get_noaddr().
> Make sense to do it here too.
Looks good.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Check return value of xfs_buf_get_noaddr()
2008-12-04 5:39 [PATCH] Check return value of xfs_buf_get_noaddr() Lachlan McIlroy
2008-12-04 7:09 ` Christoph Hellwig
@ 2008-12-04 15:28 ` Eric Sandeen
2008-12-05 2:05 ` Lachlan McIlroy
1 sibling, 1 reply; 4+ messages in thread
From: Eric Sandeen @ 2008-12-04 15:28 UTC (permalink / raw)
To: lachlan; +Cc: xfs-oss
Lachlan McIlroy wrote:
> 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;
Maybe
+ return XFS_ERROR(ENOMEM);
-Eric
> for (offset = startoff; offset <= endoff; offset = lastoffset + 1) {
> offset_fsb = XFS_B_TO_FSBT(mp, offset);
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Check return value of xfs_buf_get_noaddr()
2008-12-04 15:28 ` Eric Sandeen
@ 2008-12-05 2:05 ` Lachlan McIlroy
0 siblings, 0 replies; 4+ messages in thread
From: Lachlan McIlroy @ 2008-12-05 2:05 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs-oss
Eric Sandeen wrote:
> Lachlan McIlroy wrote:
>> 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;
>
> Maybe
>
> + return XFS_ERROR(ENOMEM);
Okay. Will do.
>
> -Eric
>
>> for (offset = startoff; offset <= endoff; offset = lastoffset + 1) {
>> offset_fsb = XFS_B_TO_FSBT(mp, offset);
>>
>> _______________________________________________
>> xfs mailing list
>> xfs@oss.sgi.com
>> http://oss.sgi.com/mailman/listinfo/xfs
>>
>
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-12-05 2:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-04 5:39 [PATCH] Check return value of xfs_buf_get_noaddr() Lachlan McIlroy
2008-12-04 7:09 ` Christoph Hellwig
2008-12-04 15:28 ` Eric Sandeen
2008-12-05 2:05 ` Lachlan McIlroy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox