* [PATCH -tip] remove the BKL: remove "BKL auto-drop" assumption from ext3_remount()
@ 2009-04-23 13:16 Alessio Igor Bogani
2009-04-26 16:39 ` Ingo Molnar
0 siblings, 1 reply; 4+ messages in thread
From: Alessio Igor Bogani @ 2009-04-23 13:16 UTC (permalink / raw)
To: Ingo Molnar
Cc: Jonathan Corbet, Frédéric Weisbecker, Peter Zijlstra,
LKML, Alessio Igor Bogani
Fix ext3_remount()'s "schedule() drops the BKL automatically" assumption,
when ext3_mark_recovery_complete(), which can sleep, does not do that it can
lock up.
Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
---
fs/ext3/super.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index dc905f9..3fa457a 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -2561,9 +2561,11 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data)
* We have to unlock super so that we can wait for
* transactions.
*/
+ unlock_kernel();
unlock_super(sb);
ext3_mark_recovery_complete(sb, es);
lock_super(sb);
+ lock_kernel();
} else {
__le32 ret;
if ((ret = EXT3_HAS_RO_COMPAT_FEATURE(sb,
--
1.6.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH -tip] remove the BKL: remove "BKL auto-drop" assumption from ext3_remount()
2009-04-23 13:16 [PATCH -tip] remove the BKL: remove "BKL auto-drop" assumption from ext3_remount() Alessio Igor Bogani
@ 2009-04-26 16:39 ` Ingo Molnar
2009-04-27 20:21 ` Alessio Igor Bogani
2009-04-27 20:22 ` [PATCH -tip:kill-the-BKL] " Alessio Igor Bogani
0 siblings, 2 replies; 4+ messages in thread
From: Ingo Molnar @ 2009-04-26 16:39 UTC (permalink / raw)
To: Alessio Igor Bogani
Cc: Jonathan Corbet, Frédéric Weisbecker, Peter Zijlstra, LKML
* Alessio Igor Bogani <abogani@texware.it> wrote:
> Fix ext3_remount()'s "schedule() drops the BKL automatically" assumption,
> when ext3_mark_recovery_complete(), which can sleep, does not do that it can
> lock up.
>
> Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
> ---
> fs/ext3/super.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/fs/ext3/super.c b/fs/ext3/super.c
> index dc905f9..3fa457a 100644
> --- a/fs/ext3/super.c
> +++ b/fs/ext3/super.c
> @@ -2561,9 +2561,11 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data)
> * We have to unlock super so that we can wait for
> * transactions.
> */
> + unlock_kernel();
> unlock_super(sb);
> ext3_mark_recovery_complete(sb, es);
> lock_super(sb);
> + lock_kernel();
Shouldnt this be a conditional-unlock, so that if the remount moves
away from under the BKL we dont break in this place?
Ingo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -tip] remove the BKL: remove "BKL auto-drop" assumption from ext3_remount()
2009-04-26 16:39 ` Ingo Molnar
@ 2009-04-27 20:21 ` Alessio Igor Bogani
2009-04-27 20:22 ` [PATCH -tip:kill-the-BKL] " Alessio Igor Bogani
1 sibling, 0 replies; 4+ messages in thread
From: Alessio Igor Bogani @ 2009-04-27 20:21 UTC (permalink / raw)
To: Ingo Molnar
Cc: Jonathan Corbet, Frédéric Weisbecker, Peter Zijlstra, LKML
Dear Sir Molnar,
2009/4/26 Ingo Molnar <mingo@elte.hu>:
[...]
>> + unlock_kernel();
>> unlock_super(sb);
>> ext3_mark_recovery_complete(sb, es);
>> lock_super(sb);
>> + lock_kernel();
>
> Shouldnt this be a conditional-unlock, so that if the remount moves
> away from under the BKL we dont break in this place?
[...]
Please excuse me I'm only a stupid howler monkey. :-)
Patch with conditional-unlock/lock follow in a second.
Thank you!
Ciao,
Alessio
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH -tip:kill-the-BKL] remove the BKL: remove "BKL auto-drop" assumption from ext3_remount()
2009-04-26 16:39 ` Ingo Molnar
2009-04-27 20:21 ` Alessio Igor Bogani
@ 2009-04-27 20:22 ` Alessio Igor Bogani
1 sibling, 0 replies; 4+ messages in thread
From: Alessio Igor Bogani @ 2009-04-27 20:22 UTC (permalink / raw)
To: Ingo Molnar
Cc: Jonathan Corbet, Frédéric Weisbecker, Peter Zijlstra,
LKML, Alessio Igor Bogani
Fix ext3_remount()'s "schedule() drops the BKL automatically" assumption,
when ext3_mark_recovery_complete(), which can sleep, does not do that it can
lock up.
Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
---
fs/ext3/super.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index dc905f9..5d61a7f 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -2503,6 +2503,7 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data)
#ifdef CONFIG_QUOTA
int i;
#endif
+ int bkl = kernel_locked();
/* Store the original options */
old_sb_flags = sb->s_flags;
@@ -2561,9 +2562,13 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data)
* We have to unlock super so that we can wait for
* transactions.
*/
+ if (bkl)
+ unlock_kernel();
unlock_super(sb);
ext3_mark_recovery_complete(sb, es);
lock_super(sb);
+ if (bkl)
+ lock_kernel();
} else {
__le32 ret;
if ((ret = EXT3_HAS_RO_COMPAT_FEATURE(sb,
--
1.6.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-04-27 20:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-23 13:16 [PATCH -tip] remove the BKL: remove "BKL auto-drop" assumption from ext3_remount() Alessio Igor Bogani
2009-04-26 16:39 ` Ingo Molnar
2009-04-27 20:21 ` Alessio Igor Bogani
2009-04-27 20:22 ` [PATCH -tip:kill-the-BKL] " Alessio Igor Bogani
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).