Louis Lam
2002-Mar-27 00:51 UTC
[Samba] Regarding killing an application that still has file opened on a smbfs mount.
Hi, I have a question regarding killing an app that still holds on to a file in a smbfs mount. When I do that, I get this message on the console: smb_get_length: recv error = 512 smb_request: result -512 setting invalid smb_retry: successful, new pid = xxxx, generation=xxx The above message is repeated. I'm using the kernel from redhat 7.1 kernel version 2.4.2(ac). What do these messages mean? Is this the correct behaviour for the smbfs? Need to know because I'm running a stackable fs on top of smbfs, and trying to see how to handle this situation. When this happens the non-root user cannot do much (ls, smbumount etc..). But if this mountpoint is mounted by root, then she can just "umount" the mountpoint. For a non-root user who is doing the mount through smbmount (suid), she can kill the smbmount process that is running in the background. BTW why is it that the smbmount program is running in the background (can see from a ps)? Thank you in advance. Louis Lam _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com
Urban Widmark
2002-Mar-27 11:53 UTC
[Samba] Re: Regarding killing an application that still has file opened on a smbfs mount.
On Wed, 27 Mar 2002, Louis Lam wrote:> When I do that, I get this message on the console: > > smb_get_length: recv error = 512 > smb_request: result -512 setting invalidsmbfs was trying to read a response and was waiting for the length of the SMB to be returned. If the server disappears you may end up with a process that will sleep for a long time. This interruption is returned by the network layer as -512 (-ERESTARTSYS). This event is logged because it is believed to be an error.> smb_retry: successful, new pid = xxxx, generation=xxxWhen there is a network error smbfs closes the tcp socket and signals smbmount. smbmount is sleeping, when it gets a signal it reconnects to the server and passes the socket to smbfs.> I'm using the kernel from redhat 7.1 kernel version 2.4.2(ac).I think smbfs in the RH7.1 kernel has some stability problems. Any reason not to use the updated kernel rpm?> What do these messages mean? Is this the correct behaviour for the smbfs?Yes, they are normal when killing the process.> When this happens the non-root user cannot do much (ls, smbumount etc..). > But if this mountpoint is mounted by root, then she can just "umount" the > mountpoint.After the successful "retry" the mount should be working again. But for you it isn't?> For a non-root user who is doing the mount through smbmount (suid), she can > kill the smbmount process that is running in the background. BTW why is it > that the smbmount program is running in the background (can see from a ps)?Killing the smbmount process is bad. It runs as a daemon and reconnects when asked to. If it disappears smbfs may send it's wakeup signal to some innocent process (the smbfs-smbmount relationship has a few flaws ...) /Urban
Louis Lam
2002-Mar-27 23:49 UTC
[Samba] Re: Regarding killing an application that still has file opened on a smbfs mount.
> >After the successful "retry" the mount should be working again. But for >you it isn't? >It seems that after the retry, the mount is still not working (e.g.user cannot go and do "ls" on the mountpoint). What else can cause this to happen? Initially we had to keep the configuration of Redhat 7.1 due to some application that we've developed that worked on redhat 7.1 only. But I'll try it on later versions of smbfs found in newer kernel releases. Thank you in advance, Louis Lam _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com
Louis Lam
2002-Mar-29 19:00 UTC
[Samba] Re: Regarding killing an application that still has file opened on a smbfs mount.
Hi, ok, here is the way to reproduce the problem. 1. Do smbmount a share from the server. 2. "vi" a file(or some other program that holds on to a file on the share) 3. kill the vi application(simulating non-graceful exit)>Does it block?If I try to "ls" that mountpoint or even try to smbumount, the process will block.>Does it cause more errors?If you mean getting more of these messages: smb_get_length: recv error = 512 smb_request: result -512 setting invalid smb_retry: successful, new pid = xxxx, generation=xxx These messages are repeated continuously.>There should be a connection between localhost and port 139 on the server. >If you look at it with netstat it should be ESTABLISHED.Indeed there was, when I do a netstat, I get the following: On the client: Proto Recv-Q Send-Q Local Address Foreign Address State ----- ------ ------ ------------- --------------- ------ tcp 0 0 10.20.30.16:1025 kitchen:netbios-ssn ESTABLISHED On the Server: Proto Recv-Q Send-Q Local Address Foreign Address State ----- ------ ------ ------------- --------------- ------ tcp 0 0 kitchen:netbios-ssn 10.20.30.16:1024 ESTABLISHED I don't see anything about port 139 though. Is that the netbios-ssn? Thank you in advance. Louis Lam _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx