public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Leonid Kalev <lion@3tera.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] [UFS] fs/ufs/super.c misreads the file system state
Date: Wed, 19 Sep 2007 09:31:47 -0700	[thread overview]
Message-ID: <46F14EF3.3050606@3tera.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 670 bytes --]

ufs_get_fs_state() needs the file system type to read the state from the 
correct place in the superblock. It takes the type from 
UFS_SB(sb)->s_flags, but that value is stored after the first call to 
ufs_get_fs_state(). The patch below moves the assignment of s_flags up, 
before the first call to ufs_get_fs_state().

The patch is against linux-2.6.23-rc6-git7, but it applies (with offset) 
to 2.6.22 and to earlier versions as well. It has been tested on the 
Solaris flavor of UFS (ufstype=sunx86) - with this change, the file 
system can be used in read-write mode.

* Please cc me when replying to this - I am not subscribed to the 
linux-kernel list. *

Leonid

[-- Attachment #2: ufs_state_bug_l.patch --]
[-- Type: text/x-patch, Size: 453 bytes --]

--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -897,6 +897,8 @@
 
 	ufs_print_super_stuff(sb, usb1, usb2, usb3);
 
+	sbi->s_flags = flags;
+
 	/*
 	 * Check, if file system was correctly unmounted.
 	 * If not, make it read only.
@@ -1026,8 +1028,6 @@
 		uspi->s_maxsymlinklen =
 		    fs32_to_cpu(sb, usb3->fs_un2.fs_44.fs_maxsymlinklen);
 	
-	sbi->s_flags = flags;
-
 	inode = iget(sb, UFS_ROOTINO);
 	if (!inode || is_bad_inode(inode))
 		goto failed;

             reply	other threads:[~2007-09-19 16:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-19 16:31 Leonid Kalev [this message]
2007-09-20 12:39 ` [PATCH] [UFS] fs/ufs/super.c misreads the file system state Satyam Sharma

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=46F14EF3.3050606@3tera.com \
    --to=lion@3tera.com \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox