Re: [PATCH] Use of getblk differs between locations

From: Glauber de Oliveira Costa (glommer_at_br.ibm.com)
Date: 10/10/05

  • Next message: Daniel Walker: "Re: Latency data - 2.6.14-rc3-rt13"
    Date:	Mon, 10 Oct 2005 18:46:05 -0300
    To: Anton Altaparmakov <aia21@cam.ac.uk>
    
    

    On Mon, Oct 10, 2005 at 10:20:07PM +0100, Anton Altaparmakov wrote:
    > Hi,
    >
    > On Mon, 10 Oct 2005, Glauber de Oliveira Costa wrote:
    > > I've just noticed that the use of sb_getblk differs between locations
    > > inside the kernel. To be precise, in some locations there are tests
    > > against its return value, and in some places there are not.
    > >
    > > According to the comments in __getblk definition, the tests are not
    > > necessary, as the function always return a buffer_head (maybe a wrong
    > > one),
    >
    > If you had read the source code rather than just the comments you would
    > have seen that this is not true. It can return NULL (see
    > fs/buffer.c::__getblk_slow()). Certainly I would prefer to keep the
    > checks in NTFS, please. They may only be good for catching bugs but I
    > like catching bugs rather than segfaulting due to a NULL dereference.

    I did. But I did not see this specifically, for sure. What takes us to
    the opposite problem: A lot of places do not check for the return value
    of getblk (Almost half of them, I'd say), and may thus lead to a
    dereferencing of a NULL pointer.

    Does anyone else have any comments on that?

    > Best regards,
    Thanks,
    > Anton
    Glauber

    > --
    > Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
    > Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
    > Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
    > WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
    >

    -- 
    =====================================
    Glauber de Oliveira Costa
    IBM Linux Technology Center - Brazil
    glommer@br.ibm.com
    =====================================
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Daniel Walker: "Re: Latency data - 2.6.14-rc3-rt13"

    Relevant Pages

    • khubd crash on scanner disconnect
      ... usb 1-1: USB disconnect, address 2 ... Unable to handle kernel NULL pointer dereference at virtual address 0000001e ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • 2.6.9-rc1 oops
      ... Unable to handle kernel NULL pointer dereference... ... Normally with 2.6.8.1 and before my routing table looks like this: ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] Use of getblk differs between locations
      ... > inside the kernel. ... checks in NTFS, please. ... They may only be good for catching bugs but I ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re[3]: pty_chars_in_buffer NULL pointer (kernel oops)
      ... P.S. new kernel - 2.4.29 vanilla ... > redundancy for now). ... > dereference at virtual address ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: 2.6.10-mm1: oops during swsusp in ac97 support
      ... I get NULL pointer ... dereference during that phase. ... I'll mail you a screenshot in a private mail. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)