Arne Jansen
2013-Feb-13 11:20 UTC
[PATCH] Btrfs: fix crash in log replay with qgroups enabled
When replaying a log tree with qgroups enabled, tree_mod_log_rewind does a sanity-check of the number of items against the maximum possible number. It calculates that number with the nodesize of fs_root. Unfortunately fs_root is not yet set at this stage. So instead use the nodesize from tree_root, which is already initialized. Signed-off-by: Arne Jansen <sensille@gmx.net> --- fs/btrfs/ctree.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index eea5da7..6eff0fa 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -1222,7 +1222,7 @@ tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct extent_buffer *eb, __tree_mod_log_rewind(eb_rewin, time_seq, tm); WARN_ON(btrfs_header_nritems(eb_rewin) > - BTRFS_NODEPTRS_PER_BLOCK(fs_info->fs_root)); + BTRFS_NODEPTRS_PER_BLOCK(fs_info->tree_root)); return eb_rewin; } -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Jan Schmidt
2013-Feb-13 13:01 UTC
Re: [PATCH] Btrfs: fix crash in log replay with qgroups enabled
On Wed, February 13, 2013 at 12:20 (+0100), Arne Jansen wrote:> When replaying a log tree with qgroups enabled, tree_mod_log_rewind does a > sanity-check of the number of items against the maximum possible number. > It calculates that number with the nodesize of fs_root. Unfortunately > fs_root is not yet set at this stage. So instead use the nodesize from > tree_root, which is already initialized. > > Signed-off-by: Arne Jansen <sensille@gmx.net> > --- > fs/btrfs/ctree.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c > index eea5da7..6eff0fa 100644 > --- a/fs/btrfs/ctree.c > +++ b/fs/btrfs/ctree.c > @@ -1222,7 +1222,7 @@ tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct extent_buffer *eb, > > __tree_mod_log_rewind(eb_rewin, time_seq, tm); > WARN_ON(btrfs_header_nritems(eb_rewin) > > - BTRFS_NODEPTRS_PER_BLOCK(fs_info->fs_root)); > + BTRFS_NODEPTRS_PER_BLOCK(fs_info->tree_root)); > > return eb_rewin; > } >Chris, please send this for the next patch round for 3.8, optionally with cc for stable (the check was added in 3.6). Thanks, -Jan -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Reasonably Related Threads
- [PATCH] Btrfs-progs: fix missing recow roots when making btrfs filesystem
- Kernel BUG: __tree_mod_log_rewind
- [PATCH v5 0/8] Btrfs scrub: print path to corrupted files and trigger nodatasum fixup
- [PATCH 05/12] Btrfs: Avoid orphan inodes cleanup during replaying log
- [PATCH] ctree code cleanups