From: Jeff Mahoney <jeffm@suse.com>
To: ReiserFS Mailing List <reiserfs-list@namesys.com>
Subject: [PATCH] -oresize on ro filesystem causes panic
Date: Mon, 19 Apr 2004 10:46:05 -0400 [thread overview]
Message-ID: <4083E62D.9060909@suse.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1094 bytes --]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hey all -
While developing my io-error patches (posted previously), I skipped the
resize stuff, opting to come back to it later, since it involved
re-ordering operations so we don't blow ourselves out of the water.
Today, I started digging into that code, and found that if -oresize is
used when the filesystem is read-only, it will attempt to start a
transaction on a read-only filesystem. When CONFIG_REISERFS_CHECK is
enabled, this causes an assertion failure.
mount -r /dev/hda8 /mnt
mount -oremount,resize=123456 /mnt
*panic*
The attached patch fixes the problem. It also moves the reiserfs_resize
call after the filesystem is made read-write on remount. This is so the
following succeeds:
mount -oremount,resize=123456,rw /mnt
- -Jeff
- --
Jeff Mahoney
SuSE Labs
jeffm@suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFAg+YtLPWxlyuTD7IRAvBXAJ9ruUhuwvqYcYoLLQxv1+76kC4XTQCfYH3E
rmTlSJjVWIJc5pVqPpv/F/s=
=aDB6
-----END PGP SIGNATURE-----
[-- Attachment #2: reiserfs-resize.diff --]
[-- Type: text/plain, Size: 1344 bytes --]
diff -rup linux-2.6.5.kgdb/fs/reiserfs/resize.c linux-2.6.5.kgdb.afs/fs/reiserfs/resize.c
--- linux-2.6.5.kgdb/fs/reiserfs/resize.c 2004-04-03 22:36:55.000000000 -0500
+++ linux-2.6.5.kgdb.afs/fs/reiserfs/resize.c 2004-04-19 10:28:53.692014416 -0400
@@ -33,6 +33,11 @@ int reiserfs_resize (struct super_block
int i;
int copy_size ;
+ if (s->s_flags & MS_RDONLY) {
+ reiserfs_warning (s, "Can't resize read-only filesystem.");
+ return -EINVAL;
+ }
+
sb = SB_DISK_SUPER_BLOCK(s);
if (SB_BLOCK_COUNT(s) >= block_count_new) {
diff -rup linux-2.6.5.kgdb/fs/reiserfs/super.c linux-2.6.5.kgdb.afs/fs/reiserfs/super.c
--- linux-2.6.5.kgdb/fs/reiserfs/super.c 2004-04-17 13:32:13.000000000 -0400
+++ linux-2.6.5.kgdb.afs/fs/reiserfs/super.c 2004-04-19 10:30:02.897493584 -0400
@@ -890,12 +890,6 @@ static int reiserfs_remount (struct supe
SB_JOURNAL_MAX_TRANS_AGE(s) = commit_max_age;
}
- if(blocks) {
- int rc = reiserfs_resize(s, blocks);
- if (rc != 0)
- return rc;
- }
-
if (*mount_flags & MS_RDONLY) {
reiserfs_xattr_init (s, *mount_flags);
/* remount read-only */
@@ -944,6 +938,12 @@ static int reiserfs_remount (struct supe
reiserfs_xattr_init (s, *mount_flags);
}
+ if(blocks) {
+ int rc = reiserfs_resize(s, blocks);
+ if (rc != 0)
+ return rc;
+ }
+
return 0;
}
reply other threads:[~2004-04-19 14:46 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=4083E62D.9060909@suse.com \
--to=jeffm@suse.com \
--cc=reiserfs-list@namesys.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 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.