add patch fix-dir_nlink-behaviour
[ext4-patch-queue.git] / release-discard-bio-after-sending-discard-commands
blobe77accf89f1be034faf775c87792828d49179c94
1 ext4: release discard bio after sending discard commands
3 From: Daeho Jeong <daeho.jeong@samsung.com>
5 We've changed the discard command handling into parallel manner.
6 But, in this change, I forgot decreasing the usage count of the bio
7 which was used to send discard request. I'm sorry about that.
9 Fixes: a015434480dc ("ext4: send parallel discards on commit completions")
10 Signed-off-by: Daeho Jeong <daeho.jeong@samsung.com>
11 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 Reviewed-by: Jan Kara <jack@suse.cz>
13 ---
14  fs/ext4/mballoc.c | 4 +++-
15  1 file changed, 3 insertions(+), 1 deletion(-)
17 diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
18 index ab70b69e644c..88317b0cf7b8 100644
19 --- a/fs/ext4/mballoc.c
20 +++ b/fs/ext4/mballoc.c
21 @@ -2892,8 +2892,10 @@ void ext4_process_freed_data(struct super_block *sb, tid_t commit_tid)
22                                 break;
23                 }
25 -               if (discard_bio)
26 +               if (discard_bio) {
27                         submit_bio_wait(discard_bio);
28 +                       bio_put(discard_bio);
29 +               }
30         }
32         list_for_each_entry_safe(entry, tmp, &freed_data_list, efd_list)
33 -- 
34 2.13.0