lkml.org 
[lkml]   [2008]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] fix flags length in net 9p

    Some files in the net/9p directory uses "int" for flags. This can
    cause hard to find bugs on some architectures. This patch converts the
    flags to use "long" instead.

    This bug was discovered by doing an allyesconfig make on the -rt kernel
    where checks are done to ensure all flags are of size sizeof(long).

    Signed-off-by: Steven Rostedt <srostedt@redhat.com>
    ---
    net/9p/trans_virtio.c | 2 +-
    net/9p/util.c | 4 ++--
    2 files changed, 3 insertions(+), 3 deletions(-)

    Index: linux-compile.git/net/9p/trans_virtio.c
    ===================================================================
    --- linux-compile.git.orig/net/9p/trans_virtio.c 2008-04-09 18:45:15.000000000 -0400
    +++ linux-compile.git/net/9p/trans_virtio.c 2008-05-01 17:02:25.000000000 -0400
    @@ -134,7 +134,7 @@ static void p9_virtio_close(struct p9_tr
    {
    struct virtio_chan *chan = trans->priv;
    int count;
    - unsigned int flags;
    + unsigned long flags;

    spin_lock_irqsave(&chan->lock, flags);
    p9_idpool_destroy(chan->tagpool);
    Index: linux-compile.git/net/9p/util.c
    ===================================================================
    --- linux-compile.git.orig/net/9p/util.c 2008-02-14 23:09:39.000000000 -0500
    +++ linux-compile.git/net/9p/util.c 2008-05-01 17:02:35.000000000 -0400
    @@ -71,7 +71,7 @@ int p9_idpool_get(struct p9_idpool *p)
    {
    int i = 0;
    int error;
    - unsigned int flags;
    + unsigned long flags;

    retry:
    if (idr_pre_get(&p->pool, GFP_KERNEL) == 0)
    @@ -102,7 +102,7 @@ EXPORT_SYMBOL(p9_idpool_get);

    void p9_idpool_put(int id, struct p9_idpool *p)
    {
    - unsigned int flags;
    + unsigned long flags;
    spin_lock_irqsave(&p->lock, flags);
    idr_remove(&p->pool, id);
    spin_unlock_irqrestore(&p->lock, flags);


    \
     
     \ /
      Last update: 2008-05-01 23:11    [W:0.021 / U:29.060 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site