From: Timothy Shimmin <tes@sgi.com>
To: Utako Kusaka <utako@tnes.nec.co.jp>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] xfs_db ring command
Date: Thu, 28 Sep 2006 10:40:38 +1000 [thread overview]
Message-ID: <451B1A06.4000507@sgi.com> (raw)
In-Reply-To: <200609270444.AA04551@TNESG9305.tnes.nec.co.jp>
Utako Kusaka wrote:
> This patch fixes the issue that
> xfs_db ring [index] command don't move to specified index.
>
> Signed-off-by: Utako Kusaka <utako@tnes.nec.co.jp>
> ---
>
> --- xfsprogs-2.8.11-orgn/db/io.c 2006-06-26 14:01:14.000000000 +0900
> +++ xfsprogs-2.8.11/db/io.c 2006-09-26 16:59:40.000000000 +0900
> @@ -352,7 +352,7 @@ ring_f(
> return 0;
> }
>
> - index = (int)strtoul(argv[0], NULL, 0);
> + index = (int)strtoul(argv[1], NULL, 0);
> if (index < 0 || index >= RING_ENTRIES)
> dbprintf("invalid entry: %d\n", index);
>
Hi there,
Thanks for that.
I'll check it in shortly.
Aside:
I think I can see how this happened.
It must have been due to porting from IRIX to Linux.
On IRIX the db commands removed the command name,
and just passed in the arguments to the specific command
function; they did:
ON IRIX:
------------
command(
int argc,
char **argv)
{
char *cmd;
const cmdinfo_t *ct;
cmd = argv[0];
ct = find_command(cmd);
if (ct == NULL) {
dbprintf("command %s not found\n", cmd);
return 0;
}
--> argc--;
--> argv++;
if (argc < ct->argmin || (ct->argmax != -1 && argc > ct->argmax)) {
...
return ct->cfunc(argc, argv);
-------------
But on Linux we pass through the command name as well:
--------------
int
command(
int argc,
char **argv)
{
char *cmd;
const cmdinfo_t *ct;
cmd = argv[0];
ct = find_command(cmd);
if (ct == NULL) {
dbprintf("command %s not found\n", cmd);
return 0;
}
if (argc-1 < ct->argmin || (ct->argmax != -1 && argc-1 > ct->argmax)) {
...
return ct->cfunc(argc, argv);
--------------
So I hope no more of these mistakes have happened because I'd
imagine many of the commands would have had to change.
I noticed that someone fixed up part of ring_f command but not the part
that you found/fixed.
Cheers,
Tim.
prev parent reply other threads:[~2006-09-28 0:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-27 4:44 [PATCH] xfs_db ring command Utako Kusaka
2006-09-28 0:40 ` Timothy Shimmin [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=451B1A06.4000507@sgi.com \
--to=tes@sgi.com \
--cc=utako@tnes.nec.co.jp \
--cc=xfs@oss.sgi.com \
/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