[Samba] Files in samba share cannot be deleted after copying failed.

Simon Wang simonnn.wang at gmail.com
Thu Oct 31 01:43:32 MDT 2013


I got a very similar issue like the following link.
https://lists.samba.org/archive/samba/2010-November/159606.html

Environment:
samba-3.5.6
arm linux 2.6.31.8
smb.conf with "reset on vc zero = yes"

Here's the procedure to reproduce:
1. Copy a file from PC to samba device
2. Unplug the LAN port during copying (simulate the flaky network)
3. Then the samba client timeout
4. Plug the LAN and reconnect PC to samba device
5. The shared file cannot be read/write/remove

I think the old connection should be deleted with "reset on vc zero = yes".
But the old connection is still alive.
And I also cannot kill the old smbd. (but kill -9 works.)

Please help....


# smbstatus
Samba version 3.5.6
PID     Username      Group         Machine
-------------------------------------------------------------------
9269      root          root          simon-tz-wang (192.168.27.119)
9166      root          root          simon-tz-wang (192.168.27.119)

Service      pid     machine       Connected at
-------------------------------------------------------
home         9166   simon-tz-wang  Thu Oct 31 15:13:38 2013
home         9269   simon-tz-wang  Thu Oct 31 15:56:11 2013
IPC$         9166   simon-tz-wang  Thu Oct 31 15:54:52 2013
IPC$         9269   simon-tz-wang  Thu Oct 31 15:56:11 2013

Locked files:
Pid          Uid        DenyMode   Access      R/W        Oplock
SharePath   Name   Time
--------------------------------------------------------------------------------------------------
9166         0          DENY_ALL   0x6019f     RDWR       EXCLUSIVE+BATCH
/home   (HD).mp4   Thu Oct 31 15:54:51 2013
9269         0          DENY_NONE  0x100081    RDONLY     NONE
/home   .   Thu Oct 31 15:56:11 2013


# ps | grep smbd
root at Ubuntu-Simon:/var/log/samba# ps aux | grep smbd
root      8766  0.0  0.1  21544  4928 ?        Ss   10:46   0:00 smbd -F
root      8768  0.0  0.0  21648  1224 ?        S    10:46   0:00 smbd -F
root      9166  0.0  0.1  22032  4272 ?        S    15:13   0:00 smbd -F
root      9269  0.0  0.1  22032  3860 ?        S    15:56   0:00 smbd -F
nobody    9271  0.0  0.1  21808  3156 ?        S    15:56   0:00 smbd -F

# cat log.192.168.27.119
....
[2013/10/31 15:56:11.216510,  3]
smbd/sesssetup.c:1333(reply_sesssetup_and_X)
  wct=12 flg2=0xc807
[2013/10/31 15:56:11.216576,  2] smbd/sesssetup.c:1279(setup_new_vc_session)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all
old resources.
[2013/10/31 15:56:11.216684,  1] smbd/sesssetup.c:1269(shutdown_other_smbds)
  shutdown_other_smbds: shutting down pid 9166 (IP 192.168.27.119)
[2013/10/31 15:56:11.216842,  1] smbd/sesssetup.c:1269(shutdown_other_smbds)
  shutdown_other_smbds: shutting down pid 9166 (IP 192.168.27.119)
[2013/10/31 15:56:11.216983,  3]
smbd/sesssetup.c:1065(reply_sesssetup_and_X_spnego)
  Doing spnego session setup
[2013/10/31 15:56:11.217050,  3]
smbd/sesssetup.c:1107(reply_sesssetup_and_X_spnego)
  NativeOS=[] NativeLanMan=[] PrimaryDomain=[]
[2013/10/31 15:56:11.217153,  3]
smbd/sesssetup.c:660(reply_spnego_negotiate)
  reply_spnego_negotiate: Got secblob of size 40
[2013/10/31 15:56:11.217724,  3]
../libcli/auth/ntlmssp.c:34(debug_ntlmssp_flags)
  Got NTLMSSP neg_flags=0xe2088297
[2013/10/31 15:56:11.219200,  3] smbd/process.c:1662(process_smb)
  Transaction 2 of length 516 (0 toread)
[2013/10/31 15:56:11.219273,  3] smbd/process.c:1467(switch_message)
  switch message SMBsesssetupX (pid 9269) conn 0x0
[2013/10/31 15:56:11.219344,  3]
smbd/sesssetup.c:1333(reply_sesssetup_and_X)
  wct=12 flg2=0xc807
[2013/10/31 15:56:11.219401,  2] smbd/sesssetup.c:1279(setup_new_vc_session)
  setup_new_vc_session: New VC == 0, if NT4.x compatible we would close all
old resources.
[2013/10/31 15:56:11.219487,  1] smbd/sesssetup.c:1269(shutdown_other_smbds)
  shutdown_other_smbds: shutting down pid 9166 (IP 192.168.27.119)
[2013/10/31 15:56:11.219638,  1] smbd/sesssetup.c:1269(shutdown_other_smbds)
  shutdown_other_smbds: shutting down pid 9166 (IP 192.168.27.119)
[2013/10/31 15:56:11.219764,  3]
smbd/sesssetup.c:1065(reply_sesssetup_and_X_spnego)
  Doing spnego session setup
[2013/10/31 15:56:11.219828,  3]
smbd/sesssetup.c:1107(reply_sesssetup_and_X_spnego)
  NativeOS=[] NativeLanMan=[] PrimaryDomain=[]
[2013/10/31 15:56:11.219903,  3]
../libcli/auth/ntlmssp_server.c:348(ntlmssp_server_preauth)
  Got user=[root] domain=[MOXACORP] workstation=[SIMON-TZ-WANG] len1=24
len2=254


More information about the samba mailing list