From: Shyam Kaushik <shyam@zadarastorage.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: RE: BUG REPORT - IDR wraps around at 30-bits - works very bad with NFSD/SCTP
Date: Tue, 13 Aug 2013 13:04:21 +0530 [thread overview]
Message-ID: <f94820b47d924f0de5b3a421876d1dce@mail.gmail.com> (raw)
In-Reply-To: <20130813073304.GA15495@kroah.com>
Sorry I added this later, but realized I couldn’t compile.
Working version of the example is
#include <linux/module.h>
#include <linux/init.h>
#include <linux/version.h>
#include <linux/idr.h>
static int log_idr_entry(int id, void *ptr, void *data)
{
int *expected_val = (int *)ptr;
pr_info("\tIDR Actual ID[%d] %s Expected Value[%d]\n", id, (id ==
*expected_val)?"==":"!=", *expected_val);
return 0;
}
static void process_idr_entry(struct idr *stateids, int min_stateid)
{
int new_stid;
int error;
pr_info("\nProcessing for min_stateid[%d]\n", min_stateid);
if (!idr_pre_get(stateids, GFP_KERNEL)) {
pr_info("Failed to pre-get\n");
return;
}
error = idr_get_new_above(stateids, &new_stid, min_stateid,
&new_stid);
if (error) {
pr_info("Failed to get new id\n");
idr_remove(stateids, new_stid);
return;
}
pr_info("Allocated new_stid[%d]\n", new_stid);
if (!idr_find(stateids, new_stid))
pr_info("BUG: Cant find ID[%d]\n", new_stid);
pr_info("Dumping entries in IDR\n");
idr_for_each(stateids, &log_idr_entry, NULL);
idr_remove(stateids, new_stid);
}
void driver_exit(void)
{
}
int driver_init(void)
{
struct idr stateids;
idr_init(&stateids);
process_idr_entry(&stateids, 0/*min_stateid*/);
process_idr_entry(&stateids, 1073741823/*min_stateid*/);
process_idr_entry(&stateids, 1073741824/*min_stateid*/);
idr_remove_all(&stateids);
idr_destroy(&stateids);
return 0;
}
module_init(driver_init);
module_exit(driver_exit);
-----Original Message-----
From: Greg KH [mailto:gregkh@linuxfoundation.org]
Sent: Tuesday, August 13, 2013 1:03 PM
To: Shyam Kaushik
Cc: linux-kernel@vger.kernel.org
Subject: Re: BUG REPORT - IDR wraps around at 30-bits - works very bad
with NFSD/SCTP
On Tue, Aug 13, 2013 at 12:31:29PM +0530, Shyam Kaushik wrote:
> pr_info("%d\n", MAX_INT);
How did this line build, there is no MAX_INT in the kernel tree.
odd.
greg k-h
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.2904 / Virus Database: 3211/6571 - Release Date: 08/12/13
prev parent reply other threads:[~2013-08-13 7:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-13 7:01 BUG REPORT - IDR wraps around at 30-bits - works very bad with NFSD/SCTP Shyam Kaushik
2013-08-13 7:19 ` Greg KH
2013-08-13 7:21 ` Shyam Kaushik
2013-08-13 7:26 ` Greg KH
2013-08-13 7:51 ` Shyam Kaushik
2013-08-13 14:51 ` Tejun Heo
2013-08-13 7:33 ` Greg KH
2013-08-13 7:34 ` Shyam Kaushik [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f94820b47d924f0de5b3a421876d1dce@mail.gmail.com \
--to=shyam@zadarastorage.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox