Re: [PATCH] 1/1: Device-Mapper: Remove 1024 devices limitation

From: Jim Houston (jim.houston_at_comcast.net)
Date: 07/07/04

  • Next message: tom st denis: "Re: 0xdeadbeef vs 0xdeadbeefL"
    To: Andrew Morton <akpm@osdl.org>
    Date:	07 Jul 2004 06:58:34 -0400
    
    

    On Tue, 2004-07-06 at 19:16, Andrew Morton wrote:
    Jim Houston <jim.houston@comcast.net> wrote:
    > >
    > > With out the test above an id beyond the allocated space will alias
    > > to one that exists. Perhaps the highest id currently allocated is
    > > 100, there will be two layers in the radix tree and the while loop
    > > above will only look at the 10 least significant bits. If you call
    > > idr_find with 1025 it will return the pointer associated with id 1.
    >
    > OK.
    >
    > > The patch I sent was against linux-2.6.7, so I missed the change to
    > > MAX_ID_SHIFT.
    >
    > How about this?
    >
    > n = idp->layers * IDR_BITS;
    > + if (id >= (1 << n))
    > + return NULL;
    > +
    > p = idp->top;
    > +
    > /* Mask off upper bits we don't use for the search. */
    > id &= MAX_ID_MASK;
    >

    Hi Andrew,

    It's not quite right. If you want to keep a count in the upper bits
    you have to mask off that count before checking if the id is beyond the
    end of the allocated space.

    Jim Houston - Concurrent Computer Corp.

    -
    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: tom st denis: "Re: 0xdeadbeef vs 0xdeadbeefL"

    Relevant Pages

    • Re: 2.6.11-rc4-mm1
      ... > On 02.23, Andrew Morton wrote: ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: [patch] del_timer_sync scalability patch
      ... On Tue, 8 Mar 2005, Andrew Morton wrote: ... is possible that a periodic timer will be scheduled on different ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: Linux 2.6.0
      ... On Thursday 18 December 2003 07:15, Andrew Morton wrote: ... Wondering if ALSA and Latest Usb updates from Greg KH will make it into ... 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: linux-2.6.7-bk2 runs faster than linux-2.6.7 ;)
      ... On Sunday 20 June 2004 01:23, Andrew Morton wrote: ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: New dev model (was [PATCH] delete devfs)
      ... On Thu, 2004-07-22 at 05:19, Andrew Morton wrote: ... That could be done by sending in smaller patches that remove devfs calls ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)