FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 05-06-2010, 10:35 AM
Surbhi Palande
 
Default writeback: fix __sync_filesystem(sb, 0) on umount

From: Dmitry Monakhov <dmonakhov@openvz.org>

BugLink: http://launchpad.net/bugs/543617

__sync_filesystem(sb, 0) is no longer works on umount because sb can
not be pined, Because s_mount sem is downed for write and s_root is NULL.
In fact umount is a special case similar to WB_SYNC_ALL, where
sb is pinned already.

BADCOMMIT: 03ba3782e8dcc5b0e1efe440d33084f066e38cae

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
(cherry-picked from https://bugzilla.kernel.org/attachment.cgi?id=26224)

Signed-off-by: Surbhi Palande <surbhi.palande@canonical.com>
---
fs/fs-writeback.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 4102f20..937a8ae 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -583,9 +583,9 @@ static int pin_sb_for_writeback(struct writeback_control *wbc,
unpin_sb_for_writeback(psb);

/*
- * Caller must already hold the ref for this
+ * Caller must already hold the ref for integrity sync, and on umount
*/
- if (wbc->sync_mode == WB_SYNC_ALL) {
+ if (wbc->sync_mode == WB_SYNC_ALL || !sb->s_root) {
WARN_ON(!rwsem_is_locked(&sb->s_umount));
return 0;
}
@@ -597,6 +597,7 @@ static int pin_sb_for_writeback(struct writeback_control *wbc,
spin_unlock(&sb_lock);
goto pinned;
}
+ WARN_ON(1);
/*
* umounted, drop rwsem again and fall through to failure
*/
--
1.7.0.4


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 05-06-2010, 12:51 PM
Stefan Bader
 
Default writeback: fix __sync_filesystem(sb, 0) on umount

On 05/06/2010 12:35 PM, Surbhi Palande wrote:
> From: Dmitry Monakhov <dmonakhov@openvz.org>
>
> BugLink: http://launchpad.net/bugs/543617
>
> __sync_filesystem(sb, 0) is no longer works on umount because sb can
> not be pined, Because s_mount sem is downed for write and s_root is NULL.
> In fact umount is a special case similar to WB_SYNC_ALL, where
> sb is pinned already.
>
> BADCOMMIT: 03ba3782e8dcc5b0e1efe440d33084f066e38cae
>
> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
> (cherry-picked from https://bugzilla.kernel.org/attachment.cgi?id=26224)
>
> Signed-off-by: Surbhi Palande <surbhi.palande@canonical.com>
> ---
> fs/fs-writeback.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index 4102f20..937a8ae 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -583,9 +583,9 @@ static int pin_sb_for_writeback(struct writeback_control *wbc,
> unpin_sb_for_writeback(psb);
>
> /*
> - * Caller must already hold the ref for this
> + * Caller must already hold the ref for integrity sync, and on umount
> */
> - if (wbc->sync_mode == WB_SYNC_ALL) {
> + if (wbc->sync_mode == WB_SYNC_ALL || !sb->s_root) {
> WARN_ON(!rwsem_is_locked(&sb->s_umount));
> return 0;
> }
> @@ -597,6 +597,7 @@ static int pin_sb_for_writeback(struct writeback_control *wbc,
> spin_unlock(&sb_lock);
> goto pinned;
> }
> + WARN_ON(1);

Hm, will users then see a warning with stack trace everytime they unmount?

> /*
> * umounted, drop rwsem again and fall through to failure
> */


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 07:47 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org