file-posix: Don't leak fd in hdev_get_max_segments
PATCH v2 1/1 file-posix: Don't leak fd in hdev_get_max_segments
--- block/file-posix.c | 3 +++ 1 file changed, 3 insertions(+)
block/file-posix.c +3 -0
@@ -703,6 +703,9 @@ static int hdev_get_max_segments(const struct stat *st) } out: +if (fd !=-1 ) { +close (fd); + }g_free (sysfspath);return ret;#else
Signature · 1 line
2.9.3
Kevin Wolf
AppliedAm 14.03.2017 um 17:12 hat Fam Zheng geschrieben:
Quoted 1 line
Signed-off-by Fam Zheng <[email protected]>
Thanks, applied to the block branch.
Kevin
Quoted 10 lines · Fam Zheng
Signed-off-by Fam Zheng <[email protected]>--- block/file-posix.c | 3 +++ 1 file changed, 3 insertions(+)block/file-posix.c +0
-0
block/file-posix.c static int hdev_get_max_segments(const struct stat *st) · line 708
Quoted 6 lines
block/file-posix.c +3
-0@@ -703,6 +703,9 @@ static int hdev_get_max_segments(const struct stat *st) } out: +if (fd !=-1 ) { +close (fd); + }
Mails crossed - I see I asked about this in reply to v1 after you already sent v2 minutes earlier.
I still think it might be nice to mention a commit id that you are fixing (one of my reply-to-self on your v1), but either way,
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Am 14.03.2017 um 17:20 hat Eric Blake geschrieben:
Quoted 21 lines · Fam Zheng
Quoted 10 lines
Signed-off-by Fam Zheng <[email protected]>--- block/file-posix.c | 3 +++ 1 file changed, 3 insertions(+)block/file-posix.c +0
-0block/file-posix.c static int hdev_get_max_segments(const struct stat *st) · line 708
Quoted 6 lines
block/file-posix.c +3
-0@@ -703,6 +703,9 @@ static int hdev_get_max_segments(const struct stat *st) } out: +if (fd !=-1 ) { +close (fd); + }Mails crossed - I see I asked about this in reply to v1 after you already sent v2 minutes earlier.
Quoted 4 lines
I still think it might be nice to mention a commit id that you are fixing (one of my reply-to-self on your v1), but either way,
Reviewed-by Eric Blake <[email protected]>
I added a sentence to the commit message: "This fixes a leaked fd introduced in commit 9103f1ce." Sounds good?
Kevin
Quoted 22 lines · Kevin Wolf
Am 14.03.2017 um 17:20 hat Eric Blake geschrieben:
Quoted 21 lines · Fam Zheng
Quoted 10 lines
Signed-off-by Fam Zheng <[email protected]>--- block/file-posix.c | 3 +++ 1 file changed, 3 insertions(+)block/file-posix.c +0
-0block/file-posix.c static int hdev_get_max_segments(const struct stat *st) · line 708
Quoted 6 lines
block/file-posix.c +3
-0@@ -703,6 +703,9 @@ static int hdev_get_max_segments(const struct stat *st) } out: +if (fd !=-1 ) { +close (fd); + }Mails crossed - I see I asked about this in reply to v1 after you already sent v2 minutes earlier.
Quoted 7 lines
Quoted 4 lines
I still think it might be nice to mention a commit id that you are fixing (one of my reply-to-self on your v1), but either way,
Reviewed-by Eric Blake <[email protected]>I added a sentence to the commit message: "This fixes a leaked fd introduced in commit
9103f1ce." Sounds good?
Works for me!
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org