diff options
author | Josef Bacik <jbacik@fusionio.com> | 2013-04-01 11:23:58 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-05-06 15:54:29 -0400 |
commit | cf79ffb5b79e8a2b587fbf218809e691bb396c98 (patch) | |
tree | 364b7dd68d1907748aa8206e291d9107ae1ba611 /fs/btrfs/super.c | |
parent | c9a9dbf2cbd1641af49bf081ca3bbe4101df3991 (diff) |
Btrfs: fix infinite loop when we abort on mount
Testing my enospc log code I managed to abort a transaction during mount, which
put me into an infinite loop. This is because of two things, first we don't
reset trans_no_join if we abort during transaction commit, which will force
anybody trying to start a transaction to just loop endlessly waiting for it to
be set to 0. But this is still just a symptom, the second issue is we don't set
the fs state to error during errors on mount. This is because we don't want to
do the flip read only thing during mount, but we still really want to set the fs
state to an error to keep us from even getting to the trans_no_join check. So
fix both of these things, make sure to reset trans_no_join if we abort during a
commit, and make sure we set the fs state to error no matter if we're mounting
or not. This should keep us from getting into this infinite loop again.
Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index c3254c995fc8..88f812eddff6 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -161,10 +161,9 @@ void __btrfs_std_error(struct btrfs_fs_info *fs_info, const char *function, | |||
161 | } | 161 | } |
162 | 162 | ||
163 | /* Don't go through full error handling during mount */ | 163 | /* Don't go through full error handling during mount */ |
164 | if (sb->s_flags & MS_BORN) { | 164 | save_error_info(fs_info); |
165 | save_error_info(fs_info); | 165 | if (sb->s_flags & MS_BORN) |
166 | btrfs_handle_error(fs_info); | 166 | btrfs_handle_error(fs_info); |
167 | } | ||
168 | } | 167 | } |
169 | 168 | ||
170 | static const char * const logtypes[] = { | 169 | static const char * const logtypes[] = { |