lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOS58YOmYPX476gkvJLGtQZEL2RyyGq6XH0ifiuKLvEOgjjhHQ@mail.gmail.com>
Date:	Sun, 3 Feb 2013 06:28:40 -0800
From:	Tejun Heo <tj@...nel.org>
To:	Steve Wise <swise@...ngridcomputing.com>
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	rusty@...tcorp.com.au, bfields@...ldses.org,
	skinsbursky@...allels.com, ebiederm@...ssion.com,
	jmorris@...ei.org, axboe@...nel.dk, Steve Wise <swise@...lsio.com>,
	linux-rdma@...r.kernel.org
Subject: Re: [PATCH 25/62] infiniband/cxgb4: convert to idr_alloc()

Hello,

On Sun, Feb 3, 2013 at 6:18 AM, Steve Wise <swise@...ngridcomputing.com> wrote:
> Is there a git tree somewhere that I can use to test these patches out?

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git convert-to-idr_alloc

>> -       return ret;
>> +       if (lock) {
>> +               idr_preload(GFP_KERNEL);
>> +               spin_lock_irq(&rhp->lock);
>> +       }
>
> The idr_preload() needs to be above the 'if (lock)', no?

No reason to preload for ATOMIC allocation.  idr_alloc() can be called
by itself.

>> +
>> +       ret = idr_alloc(idr, handle, id, id + 1, GFP_ATOMIC);
>> +
>> +       if (lock) {
>> +               spin_unlock_irq(&rhp->lock);
>> +               idr_preload_end();
>> +       }
>
> And idr_preload_end() should be after the 'if (lock)' block methinks...

Ditto.

>> +
>> +       BUG_ON(ret == -ENOSPC);
>> +       return ret < 0 ? ret : 0;
>
> What would cause ret >  0?

It's the allocated id.  In this case, ret would either be @id or -errno.

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ