赵培
2012-Apr-17 03:22 UTC
[Samba] Partially transferred files keep locked for a while after client disconnected ungracefully
Hi Experts, When copying a big file from Windows to a Samba share working with the normal TDB mode rather than CTDB mode, the Windows client disconnected from the network ungracefully such as cable unplugging or network disabling. Then, try to delete the partial transferred file from another client, we will be prompted that another program is using this file. The lock can be easily observed by smbstatus as follows: Locked files: Pid Uid DenyMode Access R/W Oplock SharePath Name Time -------------------------------------------------------------------------------- ------------------ 30142 10500 DENY_ALL 0x30196 WRONLY EXCLUSIVE+BATCH /vx/fs0 3G_File Wed Apr 11 23:14:53 2012 After a while (approximately 20 minutes), the lock was cleared by Samba and the file can be accessed again. *My question is whether there is any config item to set this lock timeout period and why this doesn't happen to CTDB?* BTW, I've already done some research and below is some findings: 1. 'veto oplock files', even setting 'oplocks = no' couldn't solve it. 2. 'reset on zero vc = yes' seems most close to what we want. But it only kills other connections coming from the same IP. 3. 'deadtime' only takes effect if the number of open files is zero. The ungracefully disconnection leaves the file open. So this doesn't work either. Thank you in advance! Regards, Pei
Volker Lendecke
2012-Apr-17 05:47 UTC
[Samba] Partially transferred files keep locked for a while after client disconnected ungracefully
On Tue, Apr 17, 2012 at 11:22:33AM +0800, ?? wrote:> When copying a big file from Windows to a Samba share working with the > normal TDB mode rather than CTDB mode, the Windows client disconnected from > the network ungracefully such as cable unplugging or network disabling. > Then, try to delete the partial transferred file from another client, we > will be prompted that another program is using this file. The lock can be > easily observed by smbstatus as follows:Try "reset on zero vc = yes" in the [global] section. Volker -- SerNet GmbH, Bahnhofsallee 1b, 37081 G?ttingen phone: +49-551-370000-0, fax: +49-551-370000-9 AG G?ttingen, HRB 2816, GF: Dr. Johannes Loxen http://www.sernet.de, mailto:kontakt at sernet.de
Possibly Parallel Threads
- Locked files stay locked - copy operation from XP to Samba fails - FIXED
- Locked files stay locked - copy operation from XP to Samba fails
- FROM WIN XP: can't copy "file": network name no longer available
- LDA: handling non-existent mail dirs
- What happens when unmirrored ZIL log device is removed ungracefully