From ba5957d07cac94a0c3f24f1f97003256908b5356 Mon Sep 17 00:00:00 2001 From: Andrzej Jakowski Date: Wed, 27 Jul 2016 12:17:24 -0700 Subject: [PATCH] Fix resource leak in the STREAM_CLOSE path. Allocated stream identifier (alloc_id) nor closed stream_id has never been deallocated in the STREAM_CLOSE path, causing issues when closed stream was reopened again. This patch fixes that problem. Signed-off-by: Andrzej Jakowski Signed-off-by: Kapil Karkra Signed-off-by: Jens Axboe --- fs/read_write.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/read_write.c b/fs/read_write.c index 7218d69b1763..6ad3dc5cea4d 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -1737,6 +1737,8 @@ SYSCALL_DEFINE4(streamid, int, fd, int, cmd, inode->i_streamid = 0; spin_unlock(&inode->i_lock); } + bdi_streamid(f.file->f_mapping->host, STREAMID_CLOSE, alloc_id); + bdi_streamid(f.file->f_mapping->host, STREAMID_CLOSE, streamid); } done: -- 2.25.1