From: Davidlohr Bueso <dave@gnu.org>
To: Sami Kerola <kerolasa@iki.fi>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH] minix: v3 super-block does not have s_state field
Date: Wed, 13 Jul 2011 00:05:31 -0400 [thread overview]
Message-ID: <1310529931.4444.7.camel@offbook> (raw)
In-Reply-To: <1310485846-3685-1-git-send-email-kerolasa@iki.fi>
On Tue, 2011-07-12 at 17:50 +0200, Sami Kerola wrote:
> Originally attempt was to use minix definitions and file system
> structures from linux/minix_fs.h, but that failed at first try.
>
> mkfs.minix.c:164:10: error: no member named 's_state' in 'struct
> minix3_super_block'
> Super3.s_state |= MINIX_VALID_FS;
> ~~~~~~ ^
> mkfs.minix.c:165:10: error: no member named 's_state' in 'struct
> minix3_super_block'
> Super3.s_state &= ~MINIX_ERROR_FS;
>
> Primary reason seems to be that the minix3 super-block does not
> have s_state field. And it looks to me that it has never had it.
> Further details about s_state can be found from minix v3 file
> system support kernel patch.
Yes, you are right. It was dropped during time for v3, but previous
versions still use it.
>
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=939b00df0306bc4b5cd25c3c3c78e89b91e72fc8
>
> Former minix disk s_state is now in kernel memory super-block
> info structure as a s_mount_state field, if someone wonders what
> happen to it.
I don't think we should always rely on having the kernel headers, that's
why the fallback is provided.
>
> Issue appeared commit a2657ae3ffb56616ac9c921886bcca8ef242499f
> (13 days ago), and hopefully not too many users where affected as
> I am not sure how bad it is to have mismatch in super-block
> structure.
It can be quite bad depending on the mismatch, in this case the kernel
skips the s_state when using v3.
I think with this patch we address the issue without removing our
fallback.
From: Davidlohr Bueso <dave@gnu.org>
Date: Tue, 12 Jul 2011 23:55:14 -0400
Subject: [PATCH] minix: remove fs state
For v3 minix superblocks the state flag (s_state) has been removed, so drop it from the structure in accordance with the kernel's representation.
Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
---
disk-utils/minix.h | 1 -
disk-utils/mkfs.minix.c | 7 ++-----
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/disk-utils/minix.h b/disk-utils/minix.h
index fc1d1c0..a13a2a4 100644
--- a/disk-utils/minix.h
+++ b/disk-utils/minix.h
@@ -62,7 +62,6 @@ struct minix3_super_block {
u16 s_pad2;
u16 s_blocksize;
u8 s_disk_version;
- u16 s_state;
};
#define BLOCK_SIZE_BITS 10
diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c
index 916dd17..06d087e 100644
--- a/disk-utils/mkfs.minix.c
+++ b/disk-utils/mkfs.minix.c
@@ -160,11 +160,8 @@ static void check_mount(void) {
static void super_set_state(void)
{
switch (fs_version) {
- case 3:
- Super3.s_state |= MINIX_VALID_FS;
- Super3.s_state &= ~MINIX_ERROR_FS;
- break;
- default:
+ case 1:
+ case 2:
Super.s_state |= MINIX_VALID_FS;
Super.s_state &= ~MINIX_ERROR_FS;
break;
--
1.7.4.1
next prev parent reply other threads:[~2011-07-13 4:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-12 15:50 [PATCH] minix: v3 super-block does not have s_state field Sami Kerola
2011-07-13 4:05 ` Davidlohr Bueso [this message]
2011-07-13 11:33 ` Sami Kerola
2011-07-13 12:12 ` Karel Zak
2011-07-13 14:54 ` Sami Kerola
2011-07-13 17:34 ` Karel Zak
2011-07-14 2:03 ` Davidlohr Bueso
2011-07-14 9:18 ` Karel Zak
2011-07-14 15:47 ` Sami Kerola
2011-07-18 22:19 ` Karel Zak
2011-07-20 18:53 ` Sami Kerola
2011-07-21 11:21 ` Karel Zak
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=1310529931.4444.7.camel@offbook \
--to=dave@gnu.org \
--cc=kerolasa@iki.fi \
--cc=util-linux@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.