mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe Saout <christophe@saout.de>
To: lkml@dhtns.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: JFS resize=0 problem in 2.6.0
Date: Fri, 02 Jan 2004 23:33:03 +0100	[thread overview]
Message-ID: <1073082782.28665.16.camel@leto.cs.pocnet.net> (raw)
In-Reply-To: <20031228153028.GB22247@faraday.dhtns.com>

Am So, den 28.12.2003 schrieb lkml@dhtns.com um 16:30:

> Let me know if I'm missing the goal of the code here, but lines 261-273
> of linux-2.6.0/fs/jfs/super.c are:
> 
> case Opt_resize:
> {
> 	char *resize = args[0].from;
> 	if (!resize || !*resize) {    /* LINE 264 HERE */
> 		*newLVSize = sb->s_bdev->bd_inode->i_size >>
> 			sb->s_blocksize_bits;
> 		if (*newLVSize == 0)
> 			printk(KERN_ERR
> 			"JFS: Cannot determine volume size\n");
> 	} else
> 		*newLVSize = simple_strtoull(resize, &resize, 0);
> 	break;
> }
> 
> It seems to me that line 264 is attempting to test for the mount 
> paramater "resize=0", and when it comes across this, resize to the full
> size of the volume.  However, this doesn't work.  I believe it should
> test for the char '0'  (*resize=='0'), not against literal zero.  

literal zero is the end of the string.

So the code checks for resize= and not resize=0.

I think your fix is wrong because it would also recognize resize=0123
because it only tests the first character.

-           if (!resize || !*resize) {
+           if (!resize || !*resize || *resize=='0')

It should probably be

+           if (!resize || !*resize || (*resize=='0' && !resize[1]))

Or better: check the integer value that is returned by simple_strtoull.

But did you test what resize= does?



  parent reply	other threads:[~2004-01-02 22:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-28 15:30 lkml
2003-12-29  0:05 ` Mike Fedyk
2004-01-02 20:12   ` Elliott Bennett
2004-01-02 21:24     ` Mike Fedyk
2004-01-02 22:28       ` Christophe Saout
2004-01-02 22:33 ` Christophe Saout [this message]
2004-01-06 15:24   ` Elliott Bennett
2004-01-05 17:07 ` Dave Kleikamp

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=1073082782.28665.16.camel@leto.cs.pocnet.net \
    --to=christophe@saout.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@dhtns.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

all inboxes | Powered by JetHome®