xfs-masters
[Top] [All Lists]

[xfs-masters] [Patch] Wrong check in fs/xfs/xfs_rtalloc.c

To: xfs-masters@xxxxxxxxxxx
Subject: [xfs-masters] [Patch] Wrong check in fs/xfs/xfs_rtalloc.c
From: Eric Sesterhenn <snakebyte@xxxxxx>
Date: Tue, 27 Jun 2006 21:45:35 +0200
Reply-to: xfs-masters@xxxxxxxxxxx
Sender: xfs-masters-bounce@xxxxxxxxxxx
hi,

coverity made me look at this code (bug id #344).
We only return with XFS_ERROR(EINVAL) if mp->m_rtdev_targp
is valid and pass it otherwise to xfs_read_buf() where some
function calls later it gets dereferenced by an assert.

Coverity flags another 18 flags in the xfs code, since
it is quite different from the rest of the kernel code maybe one
of the sgi guys might want to look at them since i have some problems
understanding the code

Signed-off-by: Eric Sesterhenn <snakebyte@xxxxxx>

--- linux-2.6.17-git11/fs/xfs/xfs_rtalloc.c.orig        2006-06-27 
21:39:05.000000000 +0200
+++ linux-2.6.17-git11/fs/xfs/xfs_rtalloc.c     2006-06-27 21:41:33.000000000 
+0200
@@ -1929,7 +1929,7 @@ xfs_growfs_rt(
        /*
         * Initial error checking.
         */
-       if (mp->m_rtdev_targp || mp->m_rbmip == NULL ||
+       if (mp->m_rtdev_targp == NULL || mp->m_rbmip == NULL ||
            (nrblocks = in->newblocks) <= sbp->sb_rblocks ||
            (sbp->sb_rblocks && (in->extsize != sbp->sb_rextsize)))
                return XFS_ERROR(EINVAL);



<Prev in Thread] Current Thread [Next in Thread>
  • [xfs-masters] [Patch] Wrong check in fs/xfs/xfs_rtalloc.c, Eric Sesterhenn <=