add patch improve-warning-directory-handling-messages
[ext4-patch-queue.git] / simplify-error-path-on-allocation-failure-in-do_get_write-access
blobfc5095ab2caa4277bbc599c6860767b7c95c4620
1 jbd2: simplify error path on allocation failure in do_get_write_access()
3 From: Jan Kara <jack@suse.cz>
5 We were acquiring bh_state_lock when allocation of buffer failed in
6 do_get_write_access() only to be able to jump to a label that releases
7 the lock and does all other checks that don't make sense for this error
8 path. Just jump into the right label instead.
10 Signed-off-by: Jan Kara <jack@suse.cz>
11 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 ---
13  fs/jbd2/transaction.c | 3 +--
14  1 file changed, 1 insertion(+), 2 deletions(-)
16 diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
17 index 2b75f0f109be..1995ea539e96 100644
18 --- a/fs/jbd2/transaction.c
19 +++ b/fs/jbd2/transaction.c
20 @@ -956,8 +956,7 @@ repeat:
21                                                __func__);
22                                         JBUFFER_TRACE(jh, "oom!");
23                                         error = -ENOMEM;
24 -                                       jbd_lock_bh_state(bh);
25 -                                       goto done;
26 +                                       goto out;
27                                 }
28                                 goto repeat;
29                         }
30 -- 
31 2.1.4