jbd: Check return value of __getblk()
PATCH 1/1 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 <[email protected]>
--- fs/jbd/journal.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
fs/jbd/journal.c +2 -0
@@ -950,6 +950,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" );
Signature · 1 line
1.7.0.4
Quoted 3 lines · Namhyung Kim
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.
Thanks. Merged.
Honza
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR