2002-09-09 20:31:55

by Skip Ford

[permalink] [raw]
Subject: [PATCH] 2.5.34 ufs/super.c

I've needed this patch since 2.5.32 to successfully mount a UFS
partition.

--- linux/fs/ufs/super.c~ Mon Sep 9 16:39:52 2002
+++ linux/fs/ufs/super.c Mon Sep 9 16:39:57 2002
@@ -605,7 +605,7 @@
}

again:
- if (sb_set_blocksize(sb, block_size)) {
+ if (!sb_set_blocksize(sb, block_size)) {
printk(KERN_ERR "UFS: failed to set blocksize\n");
goto failed;
}

--
Skip


2002-09-09 20:36:25

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH] 2.5.34 ufs/super.c


This patch is definitely correct, but on the other hand I really think
that the calling convention of sb_set_blocksize() is wrong, and instead of
returning "size for success or zero for failure ", it should return "error
code for failure or zero for success".

There's just no point to returning the same size we just passed in.

And making that calling convention the new one would make the current UFS
code be the _right_ one.

Al, comments? Why the strange calling convention?

Linus

----
On Mon, 9 Sep 2002, Skip Ford wrote:
>
> I've needed this patch since 2.5.32 to successfully mount a UFS
> partition.
>
> --- linux/fs/ufs/super.c~ Mon Sep 9 16:39:52 2002
> +++ linux/fs/ufs/super.c Mon Sep 9 16:39:57 2002
> @@ -605,7 +605,7 @@
> }
>
> again:
> - if (sb_set_blocksize(sb, block_size)) {
> + if (!sb_set_blocksize(sb, block_size)) {
> printk(KERN_ERR "UFS: failed to set blocksize\n");
> goto failed;
> }
>
>

2002-09-10 01:38:15

by Alexander Viro

[permalink] [raw]
Subject: Re: [PATCH] 2.5.34 ufs/super.c



On Mon, 9 Sep 2002, Linus Torvalds wrote:

>
> This patch is definitely correct, but on the other hand I really think
> that the calling convention of sb_set_blocksize() is wrong, and instead of
> returning "size for success or zero for failure ", it should return "error
> code for failure or zero for success".
>
> There's just no point to returning the same size we just passed in.
>
> And making that calling convention the new one would make the current UFS
> code be the _right_ one.
>
> Al, comments? Why the strange calling convention?

No particulary good reason, except keeping calling convention the same for
sb_set_blocksize() and sb_min_blocksize()...

2002-09-10 01:44:23

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH] 2.5.34 ufs/super.c


On Mon, 9 Sep 2002, Alexander Viro wrote:
>
> No particulary good reason, except keeping calling convention the same for
> sb_set_blocksize() and sb_min_blocksize()...

Ahh, that kind of makes sense. I'll apply the minimal patch from Skip (ie
not change the current convention).

Linus

2002-09-10 17:15:20

by Zwane Mwaikambo

[permalink] [raw]
Subject: Re: [PATCH] 2.5.34 ufs/super.c

On Mon, 9 Sep 2002, Skip Ford wrote:

> I've needed this patch since 2.5.32 to successfully mount a UFS
> partition.
>
> --- linux/fs/ufs/super.c~ Mon Sep 9 16:39:52 2002
> +++ linux/fs/ufs/super.c Mon Sep 9 16:39:57 2002
> @@ -605,7 +605,7 @@
> }
>
> again:
> - if (sb_set_blocksize(sb, block_size)) {
> + if (!sb_set_blocksize(sb, block_size)) {
> printk(KERN_ERR "UFS: failed to set blocksize\n");
> goto failed;
> }

Good heavens! I introduced that bug when fixing another bug a while ago, i
was pretty certain it got fixed (it got fixed in 2.4 and -dj(?))

Zwane
--
function.linuxpower.ca

2002-09-10 17:30:29

by Skip Ford

[permalink] [raw]
Subject: Re: [PATCH] 2.5.34 ufs/super.c

Zwane Mwaikambo wrote:
> On Mon, 9 Sep 2002, Skip Ford wrote:
>
> > I've needed this patch since 2.5.32 to successfully mount a UFS
> > partition.
> >
> > --- linux/fs/ufs/super.c~ Mon Sep 9 16:39:52 2002
> > +++ linux/fs/ufs/super.c Mon Sep 9 16:39:57 2002
> > @@ -605,7 +605,7 @@
> > }
> >
> > again:
> > - if (sb_set_blocksize(sb, block_size)) {
> > + if (!sb_set_blocksize(sb, block_size)) {
> > printk(KERN_ERR "UFS: failed to set blocksize\n");
> > goto failed;
> > }
>
> Good heavens! I introduced that bug when fixing another bug a while ago, i
> was pretty certain it got fixed (it got fixed in 2.4 and -dj(?))

Here's the snippet from patch-2.5.32 that did it. This just went in a
week or two ago.

- sb_set_blocksize(sb, block_size);
+ if (sb_set_blocksize(sb, block_size)) {
+ printk(KERN_ERR "UFS: failed to set blocksize\n");
+ goto failed;
+ }

--
Skip