From: Anders Larsen <al@alarsen.net>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Alan Cox <alan@redhat.com>, linux-kernel@vger.kernel.org
Subject: [PATCH][RESEND] 2.5.42 qnx4fs (2/2): recognize qnx6 file-systems
Date: Sun, 13 Oct 2002 11:56:50 +0200 [thread overview]
Message-ID: <20021013095650.GC1337@errol.alarsen.net> (raw)
Hi Linus,
please apply this patch (a forward port from 2.4.19) which replaces the
check for the QNX boot-sector signature by a check for another signature
in the superblock (the (invariant) name of the root dir).
This allows us to mount partitions created with QNX 6.1+ (that don't
have the boot-sector signature we used to check for), without breaking
existing functionality.
fs/Config.help already claims we have this functionality, so the code
really needs to be updated to reflect that...
Cheers
Anders (qnx4fs maintainer)
diff -ur linux-2.5.42.qnx4fs-patch1/fs/qnx4/inode.c linux-2.5.42/fs/qnx4/inode.c
--- linux-2.5.42.qnx4fs-patch1/fs/qnx4/inode.c Sun Oct 13 10:53:54 2002
+++ linux-2.5.42/fs/qnx4/inode.c Sun Oct 13 10:54:35 2002
@@ -356,26 +356,19 @@
sb_set_blocksize(s, QNX4_BLOCK_SIZE);
- /* Check the boot signature. Since the qnx4 code is
+ /* Check the superblock signature. Since the qnx4 code is
dangerous, we should leave as quickly as possible
if we don't belong here... */
- bh = sb_bread(s, 0);
+ bh = sb_bread(s, 1);
if (!bh) {
- printk("qnx4: unable to read the boot sector\n");
+ printk("qnx4: unable to read the superblock\n");
goto outnobh;
}
- if ( memcmp( (char*)bh->b_data + 4, "QNX4FS", 6 ) ) {
+ if ( le32_to_cpu( *(__u32*)bh->b_data ) != QNX4_SUPER_MAGIC ) {
if (!silent)
- printk("qnx4: wrong fsid in boot sector.\n");
+ printk("qnx4: wrong fsid in superblock.\n");
goto out;
}
- brelse(bh);
-
- bh = sb_bread(s, 1);
- if (!bh) {
- printk("qnx4: unable to read the superblock\n");
- goto outnobh;
- }
s->s_op = &qnx4_sops;
s->s_magic = QNX4_SUPER_MAGIC;
#ifndef CONFIG_QNX4FS_RW
@@ -583,7 +576,7 @@
return err;
}
- printk("QNX4 filesystem 0.2.2 registered.\n");
+ printk("QNX4 filesystem 0.2.3 registered.\n");
return 0;
}
reply other threads:[~2002-10-13 9:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20021013095650.GC1337@errol.alarsen.net \
--to=al@alarsen.net \
--cc=alan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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®