Commit b10a44c3 authored by Theodore Ts'o's avatar Theodore Ts'o

ext4: add might_sleep() annotations

Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: default avatarLukas Czerner <lczerner@redhat.com>
parent 19b5ef61
...@@ -43,6 +43,8 @@ handle_t *__ext4_journal_start_sb(struct super_block *sb, unsigned int line, ...@@ -43,6 +43,8 @@ handle_t *__ext4_journal_start_sb(struct super_block *sb, unsigned int line,
{ {
journal_t *journal; journal_t *journal;
might_sleep();
trace_ext4_journal_start(sb, nblocks, _RET_IP_); trace_ext4_journal_start(sb, nblocks, _RET_IP_);
if (sb->s_flags & MS_RDONLY) if (sb->s_flags & MS_RDONLY)
return ERR_PTR(-EROFS); return ERR_PTR(-EROFS);
...@@ -113,6 +115,8 @@ int __ext4_journal_get_write_access(const char *where, unsigned int line, ...@@ -113,6 +115,8 @@ int __ext4_journal_get_write_access(const char *where, unsigned int line,
{ {
int err = 0; int err = 0;
might_sleep();
if (ext4_handle_valid(handle)) { if (ext4_handle_valid(handle)) {
err = jbd2_journal_get_write_access(handle, bh); err = jbd2_journal_get_write_access(handle, bh);
if (err) if (err)
...@@ -209,6 +213,8 @@ int __ext4_handle_dirty_metadata(const char *where, unsigned int line, ...@@ -209,6 +213,8 @@ int __ext4_handle_dirty_metadata(const char *where, unsigned int line,
{ {
int err = 0; int err = 0;
might_sleep();
if (ext4_handle_valid(handle)) { if (ext4_handle_valid(handle)) {
err = jbd2_journal_dirty_metadata(handle, bh); err = jbd2_journal_dirty_metadata(handle, bh);
if (err) { if (err) {
......
...@@ -1011,6 +1011,7 @@ int ext4_mb_init_group(struct super_block *sb, ext4_group_t group) ...@@ -1011,6 +1011,7 @@ int ext4_mb_init_group(struct super_block *sb, ext4_group_t group)
struct page *page; struct page *page;
int ret = 0; int ret = 0;
might_sleep();
mb_debug(1, "init group %u\n", group); mb_debug(1, "init group %u\n", group);
this_grp = ext4_get_group_info(sb, group); this_grp = ext4_get_group_info(sb, group);
/* /*
...@@ -1082,6 +1083,7 @@ ext4_mb_load_buddy(struct super_block *sb, ext4_group_t group, ...@@ -1082,6 +1083,7 @@ ext4_mb_load_buddy(struct super_block *sb, ext4_group_t group,
struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_sb_info *sbi = EXT4_SB(sb);
struct inode *inode = sbi->s_buddy_cache; struct inode *inode = sbi->s_buddy_cache;
might_sleep();
mb_debug(1, "load group %u\n", group); mb_debug(1, "load group %u\n", group);
blocks_per_page = PAGE_CACHE_SIZE / sb->s_blocksize; blocks_per_page = PAGE_CACHE_SIZE / sb->s_blocksize;
...@@ -4217,6 +4219,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle, ...@@ -4217,6 +4219,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
unsigned int inquota = 0; unsigned int inquota = 0;
unsigned int reserv_clstrs = 0; unsigned int reserv_clstrs = 0;
might_sleep();
sb = ar->inode->i_sb; sb = ar->inode->i_sb;
sbi = EXT4_SB(sb); sbi = EXT4_SB(sb);
...@@ -4470,6 +4473,7 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode, ...@@ -4470,6 +4473,7 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode,
int err = 0; int err = 0;
int ret; int ret;
might_sleep();
if (bh) { if (bh) {
if (block) if (block)
BUG_ON(block != bh->b_blocknr); BUG_ON(block != bh->b_blocknr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment