Re: [PATCH] virtfs-proxy-helper: Fix a resource leak in main()

2020-11-27 Thread Greg Kurz
On Thu, 26 Nov 2020 19:44:24 +0100 Christian Schoenebeck wrote: [...] > > The only justification that'd deserve to be in the changelog of > > such a patch is something like "because this is good practice > > to rollback in case code moves to another function than main()". > > Well, the actual

Re: [PATCH] virtfs-proxy-helper: Fix a resource leak in main()

2020-11-26 Thread Christian Schoenebeck
On Donnerstag, 26. November 2020 19:27:19 CET Greg Kurz wrote: > On Thu, 26 Nov 2020 18:52:39 +0100 > > Christian Schoenebeck wrote: > > On Donnerstag, 26. November 2020 14:15:51 CET Alex Chen wrote: > > > Hi Greg, > > > > > > Thanks for your review. > > > > > > On 2020/11/26 20:07, Greg Kurz

Re: [PATCH] virtfs-proxy-helper: Fix a resource leak in main()

2020-11-26 Thread Greg Kurz
On Thu, 26 Nov 2020 18:52:39 +0100 Christian Schoenebeck wrote: > On Donnerstag, 26. November 2020 14:15:51 CET Alex Chen wrote: > > Hi Greg, > > > > Thanks for your review. > > > > On 2020/11/26 20:07, Greg Kurz wrote: > > > On Thu, 26 Nov 2020 10:16:24 + > > > > > > Alex Chen wrote: >

Re: [PATCH] virtfs-proxy-helper: Fix a resource leak in main()

2020-11-26 Thread Christian Schoenebeck
On Donnerstag, 26. November 2020 14:15:51 CET Alex Chen wrote: > Hi Greg, > > Thanks for your review. > > On 2020/11/26 20:07, Greg Kurz wrote: > > On Thu, 26 Nov 2020 10:16:24 + > > > > Alex Chen wrote: > >> Only one of the options -s and -f can be used. When -f is used, > >> the fd is

Re: [PATCH] virtfs-proxy-helper: Fix a resource leak in main()

2020-11-26 Thread Li Qiang
Alex Chen 于2020年11月26日周四 下午7:40写道: > > On 2020/11/26 18:50, Li Qiang wrote: > > Alex Chen > >> > >> Only one of the options -s and -f can be used. When -f is used, > >> the fd is created externally and does not need to be closed. > >> When -s is used, a new socket fd is created, and this socket

Re: [PATCH] virtfs-proxy-helper: Fix a resource leak in main()

2020-11-26 Thread Alex Chen
Hi Greg, Thanks for your review. On 2020/11/26 20:07, Greg Kurz wrote: > On Thu, 26 Nov 2020 10:16:24 + > Alex Chen wrote: > >> Only one of the options -s and -f can be used. When -f is used, >> the fd is created externally and does not need to be closed. > > The process running

Re: [PATCH] virtfs-proxy-helper: Fix a resource leak in main()

2020-11-26 Thread Greg Kurz
On Thu, 26 Nov 2020 10:16:24 + Alex Chen wrote: > Only one of the options -s and -f can be used. When -f is used, > the fd is created externally and does not need to be closed. The process running virtfs-proxy-helper has its own copy of the fd inherited from its parent. And this fd will be

Re: [PATCH] virtfs-proxy-helper: Fix a resource leak in main()

2020-11-26 Thread Alex Chen
On 2020/11/26 18:50, Li Qiang wrote: > Alex Chen >> >> Only one of the options -s and -f can be used. When -f is used, >> the fd is created externally and does not need to be closed. >> When -s is used, a new socket fd is created, and this socket fd >> needs to be closed at the end of main(). >>

Re: [PATCH] virtfs-proxy-helper: Fix a resource leak in main()

2020-11-26 Thread Li Qiang
Alex Chen 于2020年11月26日周四 下午6:29写道: > > Only one of the options -s and -f can be used. When -f is used, > the fd is created externally and does not need to be closed. > When -s is used, a new socket fd is created, and this socket fd > needs to be closed at the end of main(). > > Reported-by: Euler

[PATCH] virtfs-proxy-helper: Fix a resource leak in main()

2020-11-26 Thread Alex Chen
Only one of the options -s and -f can be used. When -f is used, the fd is created externally and does not need to be closed. When -s is used, a new socket fd is created, and this socket fd needs to be closed at the end of main(). Reported-by: Euler Robot Signed-off-by: Alex Chen ---