All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Kleikamp <dave.kleikamp@oracle.com>
To: Gu Zheng <guz.fnst@cn.fujitsu.com>
Cc: Vahram Martirosyan <vmartirosyan@gmail.com>,
	Dave Kleikamp <shaggy@kernel.org>,
	Vahram Martirosyan <vahram.martirosyan@linuxtesting.org>,
	jfs-discussion@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, spruce-project@linuxtesting.org
Subject: Re: [PATCH 2/2] jfs: Log shutdown error in jfs_freeze() function
Date: Fri, 24 May 2013 15:32:42 -0500	[thread overview]
Message-ID: <519FCE6A.9020701@oracle.com> (raw)
In-Reply-To: <519F3212.6050602@cn.fujitsu.com>

On 05/24/2013 04:25 AM, Gu Zheng wrote:
> Hi Vahram,
>    I saw the same issue in the bugzilla:
> https://bugzilla.kernel.org/show_bug.cgi?id=53331,
> and I sent out a patch this issue, but I've get any feedback.

Sorry I missed that bug. I just realized that bugzilla.kernel.org has
been sending my email to my old IBM address. I've got some catching up
to do.

> In fact, I think it's the right way to fix this issue,
> can you help to test it?

I might go with your patch for now, as it is an improvement, but I don't
really like the way that lmLogShutdown is skipped altogether during a
"nointegrity" unmount. If we skip it during a "nointegrity" freeze, we
should also skip lmLogInit on "nointegrity" unfreeze. I'd like to keep
the nointegrity logic in jfs_logmgr.c, but it would be easiest to fix in
the freeze and unfreeze functions. A code cleanup may be better than the
easy fix. I'll have to work on that.

It also looks like freeze/unfreeze doesn't take into account that two or
more mounted file systems can share the same journal. I don't know how
often, if ever, this is done in practice, but it looks like it would be
a problem. Two "nointegrity" mounts may have problem too. That should be
easy enough to verify.

Thanks,
Shaggy

> 
> Thanks,
> Gu
> 
> 
> On 05/24/2013 04:57 PM, Vahram Martirosyan wrote:
> 
>> In function jfs_freeze() the log is shut down through lmLogShutdown() call.
>> When the "nointegrity" mount option is enabled, the log is actually not
>> initialized. As a result the freeze operation in that case brings to a
>> kernel OOPS.
>>
>> The solution is to check if the "nointegrity" option is enabled and if it is not
>> then shut the log down. 
>>
>> May be this is not the best solution, but at least it fixes the OOPS.
>>
>> Found by Linux File System Verification project (linuxtesting.org)
>>
>> Signed-off-by: Vahram Martirosyan <vahram.martirosyan@linuxtesting.org>
>> ---
>>  fs/jfs/super.c | 10 ++++++----
>>  1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/fs/jfs/super.c b/fs/jfs/super.c
>> index a3d424d..9788970 100644
>> --- a/fs/jfs/super.c
>> +++ b/fs/jfs/super.c
>> @@ -615,10 +615,12 @@ static int jfs_freeze(struct super_block *sb)
>>  
>>  	if (!(sb->s_flags & MS_RDONLY)) {
>>  		txQuiesce(sb);
>> -		rc = lmLogShutdown(log);
>> -		if (rc != 0) {
>> -			jfs_err("lmLogShutdown failed with return code %d", rc);
>> -			return rc;
>> +		if (!log->no_integrity) {
>> +			rc = lmLogShutdown(log);
>> +			if (rc != 0) {
>> +				jfs_err("lmLogShutdown failed with return code %d", rc);
>> +				return rc;
>> +			}
>>  		}
>>  		rc = updateSuper(sb, FM_CLEAN);
>>  		if (rc != 0) {
> 
> 

  reply	other threads:[~2013-05-24 20:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-24  8:57 [PATCH 1/2] jfs: Several bugs in jfs_freeze() and jfs_unfreeze() Vahram Martirosyan
2013-05-24  8:57 ` [PATCH 2/2] jfs: Log shutdown error in jfs_freeze() function Vahram Martirosyan
2013-05-24  9:25   ` Gu Zheng
2013-05-24 20:32     ` Dave Kleikamp [this message]
2013-05-24 17:03 ` [Jfs-discussion] [PATCH 1/2] jfs: Several bugs in jfs_freeze() and jfs_unfreeze() Dave Kleikamp
2013-05-24 21:01   ` [PATCH] " Dave Kleikamp

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=519FCE6A.9020701@oracle.com \
    --to=dave.kleikamp@oracle.com \
    --cc=guz.fnst@cn.fujitsu.com \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shaggy@kernel.org \
    --cc=spruce-project@linuxtesting.org \
    --cc=vahram.martirosyan@linuxtesting.org \
    --cc=vmartirosyan@gmail.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.