diff options
author | Kazuya Mio <k-mio@sx.jp.nec.com> | 2011-12-01 02:51:07 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-17 16:38:47 -0500 |
commit | e1616300a20c80396109c1cf013ba9a36055a3da (patch) | |
tree | 97d4bcef12fddf1dc1cdfd22bf226eb36850c6e6 /fs | |
parent | c2bc3a316a7281f67e36b34dac2802cbe36a9128 (diff) |
wake up s_wait_unfrozen when ->freeze_fs fails
dd slept infinitely when fsfeeze failed because of EIO.
To fix this problem, if ->freeze_fs fails, freeze_super() wakes up
the tasks waiting for the filesystem to become unfrozen.
When s_frozen isn't SB_UNFROZEN in __generic_file_aio_write(),
the function sleeps until FITHAW ioctl wakes up s_wait_unfrozen.
However, if ->freeze_fs fails, s_frozen is set to SB_UNFROZEN and then
freeze_super() returns an error number. In this case, FITHAW ioctl returns
EINVAL because s_frozen is already SB_UNFROZEN. There is no way to wake up
s_wait_unfrozen, so __generic_file_aio_write() sleeps infinitely.
Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/super.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/super.c b/fs/super.c index de41e1e46f09..6015c02296b7 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -1186,6 +1186,8 @@ int freeze_super(struct super_block *sb) | |||
1186 | printk(KERN_ERR | 1186 | printk(KERN_ERR |
1187 | "VFS:Filesystem freeze failed\n"); | 1187 | "VFS:Filesystem freeze failed\n"); |
1188 | sb->s_frozen = SB_UNFROZEN; | 1188 | sb->s_frozen = SB_UNFROZEN; |
1189 | smp_wmb(); | ||
1190 | wake_up(&sb->s_wait_unfrozen); | ||
1189 | deactivate_locked_super(sb); | 1191 | deactivate_locked_super(sb); |
1190 | return ret; | 1192 | return ret; |
1191 | } | 1193 | } |