diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-12-29 15:51:15 -0500 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-12-29 16:34:59 -0500 |
commit | 98ea3f50bcc97689cc0e1fa3b6733f03aeb8fef4 (patch) | |
tree | d909a47008ed466e5119f21f366934be5a6276b8 /fs | |
parent | 47376ceba54600cec4dd9e7c4fe8b98e4269633a (diff) |
reiserfs: Fix remaining in-reclaim-fs <-> reclaim-fs-on locking inversion
Commit 500f5a0bf5f0624dae34307010e240ec090e4cde
(reiserfs: Fix possible recursive lock) fixed a vmalloc under reiserfs
lock that triggered a lockdep warning because of a
IN-FS-RECLAIM <-> RECLAIM-FS-ON locking dependency inversion.
But this patch has ommitted another vmalloc call in the same path
that allocates the journal. Relax the lock for this one too.
Reported-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/reiserfs/journal.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index 2f8a7e7b8dab..a059879667b1 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c | |||
@@ -2758,11 +2758,18 @@ int journal_init(struct super_block *sb, const char *j_dev_name, | |||
2758 | struct reiserfs_journal *journal; | 2758 | struct reiserfs_journal *journal; |
2759 | struct reiserfs_journal_list *jl; | 2759 | struct reiserfs_journal_list *jl; |
2760 | char b[BDEVNAME_SIZE]; | 2760 | char b[BDEVNAME_SIZE]; |
2761 | int ret; | ||
2761 | 2762 | ||
2763 | /* | ||
2764 | * Unlock here to avoid various RECLAIM-FS-ON <-> IN-RECLAIM-FS | ||
2765 | * dependency inversion warnings. | ||
2766 | */ | ||
2767 | reiserfs_write_unlock(sb); | ||
2762 | journal = SB_JOURNAL(sb) = vmalloc(sizeof(struct reiserfs_journal)); | 2768 | journal = SB_JOURNAL(sb) = vmalloc(sizeof(struct reiserfs_journal)); |
2763 | if (!journal) { | 2769 | if (!journal) { |
2764 | reiserfs_warning(sb, "journal-1256", | 2770 | reiserfs_warning(sb, "journal-1256", |
2765 | "unable to get memory for journal structure"); | 2771 | "unable to get memory for journal structure"); |
2772 | reiserfs_write_lock(sb); | ||
2766 | return 1; | 2773 | return 1; |
2767 | } | 2774 | } |
2768 | memset(journal, 0, sizeof(struct reiserfs_journal)); | 2775 | memset(journal, 0, sizeof(struct reiserfs_journal)); |
@@ -2771,10 +2778,12 @@ int journal_init(struct super_block *sb, const char *j_dev_name, | |||
2771 | INIT_LIST_HEAD(&journal->j_working_list); | 2778 | INIT_LIST_HEAD(&journal->j_working_list); |
2772 | INIT_LIST_HEAD(&journal->j_journal_list); | 2779 | INIT_LIST_HEAD(&journal->j_journal_list); |
2773 | journal->j_persistent_trans = 0; | 2780 | journal->j_persistent_trans = 0; |
2774 | if (reiserfs_allocate_list_bitmaps(sb, | 2781 | ret = reiserfs_allocate_list_bitmaps(sb, journal->j_list_bitmap, |
2775 | journal->j_list_bitmap, | 2782 | reiserfs_bmap_count(sb)); |
2776 | reiserfs_bmap_count(sb))) | 2783 | reiserfs_write_lock(sb); |
2784 | if (ret) | ||
2777 | goto free_and_return; | 2785 | goto free_and_return; |
2786 | |||
2778 | allocate_bitmap_nodes(sb); | 2787 | allocate_bitmap_nodes(sb); |
2779 | 2788 | ||
2780 | /* reserved for journal area support */ | 2789 | /* reserved for journal area support */ |