diff options
author | Theodore Ts'o <tytso@mit.edu> | 2013-04-03 22:00:52 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-04-03 22:00:52 -0400 |
commit | b10a44c369d7b8a28825f1fd24f13dc31c2e3a25 (patch) | |
tree | 244d322cfb2a43b217c9f6ce2cb866856ef9e8ed | |
parent | 19b5ef615787062a87c4ea15fcdb0e256b62ed19 (diff) |
ext4: add might_sleep() annotations
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
-rw-r--r-- | fs/ext4/ext4_jbd2.c | 6 | ||||
-rw-r--r-- | fs/ext4/mballoc.c | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c index 7058975e3a55..0e1dc9e70ce5 100644 --- a/fs/ext4/ext4_jbd2.c +++ b/fs/ext4/ext4_jbd2.c | |||
@@ -43,6 +43,8 @@ handle_t *__ext4_journal_start_sb(struct super_block *sb, unsigned int line, | |||
43 | { | 43 | { |
44 | journal_t *journal; | 44 | journal_t *journal; |
45 | 45 | ||
46 | might_sleep(); | ||
47 | |||
46 | trace_ext4_journal_start(sb, nblocks, _RET_IP_); | 48 | trace_ext4_journal_start(sb, nblocks, _RET_IP_); |
47 | if (sb->s_flags & MS_RDONLY) | 49 | if (sb->s_flags & MS_RDONLY) |
48 | return ERR_PTR(-EROFS); | 50 | return ERR_PTR(-EROFS); |
@@ -113,6 +115,8 @@ int __ext4_journal_get_write_access(const char *where, unsigned int line, | |||
113 | { | 115 | { |
114 | int err = 0; | 116 | int err = 0; |
115 | 117 | ||
118 | might_sleep(); | ||
119 | |||
116 | if (ext4_handle_valid(handle)) { | 120 | if (ext4_handle_valid(handle)) { |
117 | err = jbd2_journal_get_write_access(handle, bh); | 121 | err = jbd2_journal_get_write_access(handle, bh); |
118 | if (err) | 122 | if (err) |
@@ -209,6 +213,8 @@ int __ext4_handle_dirty_metadata(const char *where, unsigned int line, | |||
209 | { | 213 | { |
210 | int err = 0; | 214 | int err = 0; |
211 | 215 | ||
216 | might_sleep(); | ||
217 | |||
212 | if (ext4_handle_valid(handle)) { | 218 | if (ext4_handle_valid(handle)) { |
213 | err = jbd2_journal_dirty_metadata(handle, bh); | 219 | err = jbd2_journal_dirty_metadata(handle, bh); |
214 | if (err) { | 220 | if (err) { |
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index ee6614bdb639..36c82a39d03f 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -1011,6 +1011,7 @@ int ext4_mb_init_group(struct super_block *sb, ext4_group_t group) | |||
1011 | struct page *page; | 1011 | struct page *page; |
1012 | int ret = 0; | 1012 | int ret = 0; |
1013 | 1013 | ||
1014 | might_sleep(); | ||
1014 | mb_debug(1, "init group %u\n", group); | 1015 | mb_debug(1, "init group %u\n", group); |
1015 | this_grp = ext4_get_group_info(sb, group); | 1016 | this_grp = ext4_get_group_info(sb, group); |
1016 | /* | 1017 | /* |
@@ -1082,6 +1083,7 @@ ext4_mb_load_buddy(struct super_block *sb, ext4_group_t group, | |||
1082 | struct ext4_sb_info *sbi = EXT4_SB(sb); | 1083 | struct ext4_sb_info *sbi = EXT4_SB(sb); |
1083 | struct inode *inode = sbi->s_buddy_cache; | 1084 | struct inode *inode = sbi->s_buddy_cache; |
1084 | 1085 | ||
1086 | might_sleep(); | ||
1085 | mb_debug(1, "load group %u\n", group); | 1087 | mb_debug(1, "load group %u\n", group); |
1086 | 1088 | ||
1087 | blocks_per_page = PAGE_CACHE_SIZE / sb->s_blocksize; | 1089 | blocks_per_page = PAGE_CACHE_SIZE / sb->s_blocksize; |
@@ -4217,6 +4219,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle, | |||
4217 | unsigned int inquota = 0; | 4219 | unsigned int inquota = 0; |
4218 | unsigned int reserv_clstrs = 0; | 4220 | unsigned int reserv_clstrs = 0; |
4219 | 4221 | ||
4222 | might_sleep(); | ||
4220 | sb = ar->inode->i_sb; | 4223 | sb = ar->inode->i_sb; |
4221 | sbi = EXT4_SB(sb); | 4224 | sbi = EXT4_SB(sb); |
4222 | 4225 | ||
@@ -4470,6 +4473,7 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode, | |||
4470 | int err = 0; | 4473 | int err = 0; |
4471 | int ret; | 4474 | int ret; |
4472 | 4475 | ||
4476 | might_sleep(); | ||
4473 | if (bh) { | 4477 | if (bh) { |
4474 | if (block) | 4478 | if (block) |
4475 | BUG_ON(block != bh->b_blocknr); | 4479 | BUG_ON(block != bh->b_blocknr); |