2005-10-09 19:58:32

by Blaisorblade

[permalink] [raw]
Subject: [PATCH] Fix ext3 warning for unused var

From: Paolo 'Blaisorblade' Giarrusso <[email protected]>

Fix a gcc warning about an unused var. Introduced in commit
275abf5b06676ca057cf3e15f0d027eafcb204a0, after 2.6.14-rc2.
I just verified this is still current as of commit
829841146878e082613a49581ae252c071057c23.
Can please someone merge this? It's the 3rd time I send it.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[email protected]>
---

fs/ext3/super.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/ext3/super.c b/fs/ext3/super.c
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -513,7 +513,9 @@ static void ext3_clear_inode(struct inod
static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs)
{
struct super_block *sb = vfs->mnt_sb;
+#if defined(CONFIG_QUOTA)
struct ext3_sb_info *sbi = EXT3_SB(sb);
+#endif

if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA)
seq_puts(seq, ",data=journal");


2005-10-09 20:16:35

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH] Fix ext3 warning for unused var



On Sun, 9 Oct 2005, Paolo 'Blaisorblade' Giarrusso wrote:
>
> Can please someone merge this? It's the 3rd time I send it.

I don't like #ifdef's in code.

You could just have split up the quota-specific stuff into a function of
their own: "ext3_show_quota_options()". The patch might have been larger,
but it would actually clean up the code rather than make it uglier.

Warnings are not a reason for ugly code.

Linus

2005-10-09 21:20:39

by jmerkey

[permalink] [raw]
Subject: Re: [PATCH] Fix ext3 warning for unused var

Linus Torvalds wrote:

>On Sun, 9 Oct 2005, Paolo 'Blaisorblade' Giarrusso wrote:
>
>
>>Can please someone merge this? It's the 3rd time I send it.
>>
>>
>
>I don't like #ifdef's in code.
>
>You could just have split up the quota-specific stuff into a function of
>their own: "ext3_show_quota_options()". The patch might have been larger,
>but it would actually clean up the code rather than make it uglier.
>
>Warnings are not a reason for ugly code.
>
> Linus
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to [email protected]
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/
>
>
>
Someone needs to fix fsck.ext3 while they are at it so it doesn't barf
when reading from reisferfs filesystems and return a command return of >
2 during scanning of parttions during bootup. This looks like some sort
of anti-competitive crap and it doesn't belong in fsck.ext3 since
reiserfs is in the kernel.

J

2005-10-09 21:29:23

by Al Viro

[permalink] [raw]
Subject: Re: [PATCH] Fix ext3 warning for unused var

On Sun, Oct 09, 2005 at 01:53:23PM -0600, jmerkey wrote:
> Someone needs to fix fsck.ext3 while they are at it so it doesn't barf
> when reading from reisferfs filesystems and return a command return of >
> 2 during scanning of parttions during bootup. This looks like some sort
> of anti-competitive crap and it doesn't belong in fsck.ext3 since
> reiserfs is in the kernel.

Huh? WTF are you trying to feed reiserfs to fsck.ext3 and just what do
you expect it to do?

2005-10-09 21:45:19

by jmerkey

[permalink] [raw]
Subject: Re: [PATCH] Fix ext3 warning for unused var

Al Viro wrote:

>On Sun, Oct 09, 2005 at 01:53:23PM -0600, jmerkey wrote:
>
>
>>Someone needs to fix fsck.ext3 while they are at it so it doesn't barf
>>when reading from reisferfs filesystems and return a command return of >
>>2 during scanning of parttions during bootup. This looks like some sort
>>of anti-competitive crap and it doesn't belong in fsck.ext3 since
>>reiserfs is in the kernel.
>>
>>
>
>Huh? WTF are you trying to feed reiserfs to fsck.ext3 and just what do
>you expect it to do?
>
>
>
If they all use the same on disk formats as their basic structure, fsck
should not return gt > 1 due to misinterpreting reiser on-disk
structures. It should say "oh not one of mine, skipping". Instead it
returns an error claiming massive corruption, and halts the system. I
just upgraded my wifes computer from Suse to RedHat FC4 and when it hits
the reiser partitions, the whole system explodes due to fsck.ext3
misrecognizing reiser partitions. I had to modify rc.sysinit and blank
the partitions with fdisk to get it to install. After it installed, I
recreated the partitions (after writing down what they were in the first
place for block #'s etc.) and disabled rc.sysinit checks. This is
busted. Hans needs to fix fsck.ext3 and submit a patch or redhat does.

J


2005-10-09 22:08:42

by Al Viro

[permalink] [raw]
Subject: Re: [PATCH] Fix ext3 warning for unused var

On Sun, Oct 09, 2005 at 02:18:17PM -0600, jmerkey wrote:
> If they all use the same on disk formats as their basic structure,

ext3 and reiserfs? No, they do not.

> fsck
> should not return gt > 1 due to misinterpreting reiser on-disk
> structures. It should say "oh not one of mine, skipping". Instead it
> returns an error claiming massive corruption, and halts the system. I
> just upgraded my wifes computer from Suse to RedHat FC4 and when it hits
> the reiser partitions, the whole system explodes due to fsck.ext3
> misrecognizing reiser partitions.

Since when does fsck run fsck.ext3 on filesystems that are not marked
as ext3 in /etc/fstab?

>I had to modify rc.sysinit and blank
> the partitions with fdisk to get it to install. After it installed, I
> recreated the partitions (after writing down what they were in the first
> place for block #'s etc.) and disabled rc.sysinit checks. This is
> busted. Hans needs to fix fsck.ext3 and submit a patch or redhat does.

Sorry, but I doubt that Hans or anybody in RH knows how to patch wetware,
let alone one as messed up as yours.

2005-10-09 23:47:08

by Al Viro

[permalink] [raw]
Subject: Re: [PATCH] Fix ext3 warning for unused var

On Sun, Oct 09, 2005 at 04:13:51PM -0600, jmerkey wrote:
> >Sorry, but I doubt that Hans or anybody in RH knows how to patch
> >
>
> ---> wetware, <----
>
> Is this the new "official" non-official slang word for Suse Linux?

That's fairly old and unless the contents of your skull is even weirder
than I ever thought, the answer's "no".

> >let alone one as messed up as yours.

2005-10-09 23:40:52

by jmerkey

[permalink] [raw]
Subject: Re: [PATCH] Fix ext3 warning for unused var

Al Viro wrote:

>On Sun, Oct 09, 2005 at 02:18:17PM -0600, jmerkey wrote:
>
>
>>If they all use the same on disk formats as their basic structure,
>>
>>
>
>ext3 and reiserfs? No, they do not.
>
>
>
>>fsck
>>should not return gt > 1 due to misinterpreting reiser on-disk
>>structures. It should say "oh not one of mine, skipping". Instead it
>>returns an error claiming massive corruption, and halts the system. I
>>just upgraded my wifes computer from Suse to RedHat FC4 and when it hits
>>the reiser partitions, the whole system explodes due to fsck.ext3
>>misrecognizing reiser partitions.
>>
>>
>
>Since when does fsck run fsck.ext3 on filesystems that are not marked
>as ext3 in /etc/fstab?
>
>
>
>>I had to modify rc.sysinit and blank
>>the partitions with fdisk to get it to install. After it installed, I
>>recreated the partitions (after writing down what they were in the first
>>place for block #'s etc.) and disabled rc.sysinit checks. This is
>>busted. Hans needs to fix fsck.ext3 and submit a patch or redhat does.
>>
>>
>
>Sorry, but I doubt that Hans or anybody in RH knows how to patch
>

---> wetware, <----

Is this the new "official" non-official slang word for Suse Linux?

Jeff


>let alone one as messed up as yours.
>-
>
>

2005-10-09 23:56:40

by Valdis Klētnieks

[permalink] [raw]
Subject: Re: [PATCH] Fix ext3 warning for unused var

On Sun, 09 Oct 2005 16:13:51 MDT, jmerkey said:

> ---> wetware, <----
>
> Is this the new "official" non-official slang word for Suse Linux?

No.

http://www.catb.org/~esr/jargon/html/W/wetware.html


Attachments:
(No filename) (226.00 B)

2005-10-09 23:59:07

by Valdis Klētnieks

[permalink] [raw]
Subject: Re: [PATCH] Fix ext3 warning for unused var

On Sun, 09 Oct 2005 23:08:38 BST, Al Viro said:

> Since when does fsck run fsck.ext3 on filesystems that are not marked
> as ext3 in /etc/fstab?

Part of the problem is that if a partition is formatted with mkfs.ext3,
it gets an ext3 magic number scribbled at a known offset into the partition.
If you then reformat it with mkfs.reiserfs, that scribbles a different
magic number elsewhere on the partition, but leaves the ext3 magic number
intact. As a result, if you forget to update /etc/fstab, fsck.ext3 checks
for its magic number, finds it, concludes it's probably an ext3, and then
discovers that everything is totally scrogged.....

Yes, it's pilot error, but it's definitely hitting your feet with much larger
caliber rounds than you would have expected... :)


Attachments:
(No filename) (226.00 B)

2005-10-10 00:14:49

by jmerkey

[permalink] [raw]
Subject: Re: [PATCH] Fix ext3 warning for unused var

[email protected] wrote:

>On Sun, 09 Oct 2005 23:08:38 BST, Al Viro said:
>
>
>
>>Since when does fsck run fsck.ext3 on filesystems that are not marked
>>as ext3 in /etc/fstab?
>>
>>
>
>Part of the problem is that if a partition is formatted with mkfs.ext3,
>it gets an ext3 magic number scribbled at a known offset into the partition.
>If you then reformat it with mkfs.reiserfs, that scribbles a different
>magic number elsewhere on the partition, but leaves the ext3 magic number
>intact. As a result, if you forget to update /etc/fstab, fsck.ext3 checks
>for its magic number, finds it, concludes it's probably an ext3, and then
>discovers that everything is totally scrogged.....
>
>Yes, it's pilot error, but it's definitely hitting your feet with much larger
>caliber rounds than you would have expected... :)
>
>

Yep. Needs to get fixed because when you upgrade from a reiserfs
system and try to keep the reiserfs partitions and add a new hard drive
(+1) to
an existing system, you run the risk of corrupting resiferfs partitions.

Jeff


2005-10-10 01:43:48

by Gene Heskett

[permalink] [raw]
Subject: Re: [PATCH] Fix ext3 warning for unused var

On Sunday 09 October 2005 18:13, jmerkey wrote:
>Al Viro wrote:
[...]
>>Sorry, but I doubt that Hans or anybody in RH knows how to patch
>
>---> wetware, <----
>
>Is this the new "official" non-official slang word for Suse Linux?

Not hardly Jeff, where have you been? Wetware refers to the brain of the
individual being targeted.

--
Cheers, Gene
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
99.35% setiathome rank, not too shabby for a WV hillbilly
Yahoo.com and AOL/TW attorneys please note, additions to the above
message by Gene Heskett are:
Copyright 2005 by Maurice Eugene Heskett, all rights reserved.

2005-10-10 11:02:51

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH] Fix ext3 warning for unused var

jmerkey <[email protected]> writes:
>
> Yep. Needs to get fixed because when you upgrade from a reiserfs
> system and try to keep the reiserfs partitions and add a new hard
> drive (+1) to
> an existing system, you run the risk of corrupting resiferfs
> partitions. Jeff

Newer mkreiserfs overwrites the beginning of the partition to
avoid that. Probably yours was created with a very old one.

-Andi

2005-10-28 18:23:54

by Peter Osterlund

[permalink] [raw]
Subject: Re: [PATCH] Fix ext3 warning for unused var

Linus Torvalds <[email protected]> writes:

> On Sun, 9 Oct 2005, Paolo 'Blaisorblade' Giarrusso wrote:
> >
> > Can please someone merge this? It's the 3rd time I send it.
>
> I don't like #ifdef's in code.
>
> You could just have split up the quota-specific stuff into a function of
> their own: "ext3_show_quota_options()". The patch might have been larger,
> but it would actually clean up the code rather than make it uglier.
>
> Warnings are not a reason for ugly code.

Fix compile warning in ext3 quota code.

Signed-off-by: Peter Osterlund <[email protected]>
---

fs/ext3/super.c | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 9e24ceb..097383c 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -510,19 +510,11 @@ static void ext3_clear_inode(struct inod
kfree(rsv);
}

-static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs)
+static inline void ext3_show_quota_options(struct seq_file *seq, struct super_block *sb)
{
- struct super_block *sb = vfs->mnt_sb;
+#if defined(CONFIG_QUOTA)
struct ext3_sb_info *sbi = EXT3_SB(sb);

- if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA)
- seq_puts(seq, ",data=journal");
- else if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA)
- seq_puts(seq, ",data=ordered");
- else if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_WRITEBACK_DATA)
- seq_puts(seq, ",data=writeback");
-
-#if defined(CONFIG_QUOTA)
if (sbi->s_jquota_fmt)
seq_printf(seq, ",jqfmt=%s",
(sbi->s_jquota_fmt == QFMT_VFS_OLD) ? "vfsold": "vfsv0");
@@ -539,6 +531,20 @@ static int ext3_show_options(struct seq_
if (sbi->s_mount_opt & EXT3_MOUNT_GRPQUOTA)
seq_puts(seq, ",grpquota");
#endif
+}
+
+static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs)
+{
+ struct super_block *sb = vfs->mnt_sb;
+
+ if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA)
+ seq_puts(seq, ",data=journal");
+ else if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA)
+ seq_puts(seq, ",data=ordered");
+ else if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_WRITEBACK_DATA)
+ seq_puts(seq, ",data=writeback");
+
+ ext3_show_quota_options(seq, sb);

return 0;
}

--
Peter Osterlund - [email protected]
http://web.telia.com/~u89404340