mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 08:14:15 +08:00
jbd: Check return value of __getblk()
Fail journal creation if __getblk() returns NULL. unlikely() is added because it is called in a loop and we've been OK without the check until now. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
parent
81a4e320e6
commit
2a0e33889b
@ -952,6 +952,8 @@ int journal_create(journal_t *journal)
|
||||
if (err)
|
||||
return err;
|
||||
bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize);
|
||||
if (unlikely(!bh))
|
||||
return -ENOMEM;
|
||||
lock_buffer(bh);
|
||||
memset (bh->b_data, 0, journal->j_blocksize);
|
||||
BUFFER_TRACE(bh, "marking dirty");
|
||||
|
Loading…
Reference in New Issue
Block a user