Re: A process killed while opening a file can result in leaked open handle on the server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/13/19 12:49 AM, Ronnie Sahlberg wrote:
> Steve, Pavel
> 
> This patch goes ontop of Pavels patch.
> Maybe it should be merged with Pavels patch since his patch changes from "we only send a close() on an interrupted open()"
> to now "we send a close() on either interrupted open() or interrupted close()" so both comments as well as log messages are updates.
> 
> Additionally it adds logging of the MID that failed in the case of an interrupted Open() so that it is easy to find it in wireshark
> and check whether that smb2 file handle was indeed handles by a SMB_Close() or not.
> 
> 
> From testing it appears Pavels patch works. When the close() is interrupted we don't leak handles as far as I can tell.
> We do have a leak in the Open() case though and it seems that eventhough we set things up and flags the MID to be cancelled we actually never end up
> calling smb2_cancelled_close_fid() and thus we never send a SMB2_Close().
> I haven't found the root cause yet but I suspect we mess up mid flags or state somewhere.
> 
> 
> It did work in the past though when Sachin provided the initial implementation so we have regressed I think.
> I have added a new test 'cifs/102'  to the buildbot that checks for this but have not integrated into the cifs-testing run yet since we still fail this test.
> At least we will not have further regressions once we fix this and enable the test in the future.
> 
> ronnie s

The patches do indeed improve it significantly.

I'm still seeing some leak as well, and I'm removing ratelimiting so
that I can see what the added debugging is trying to tell us.  I'll
report if I find more details.


Thanks for the help.


Frank





[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux