From: Andrzej Jakowski Date: Wed, 27 Jul 2016 19:17:24 +0000 (-0700) Subject: Fix resource leak in the STREAM_CLOSE path. X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=refs%2Fheads%2Fio-streamid;p=linux-2.6-block.git 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 --- 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: