Bug 7728 - Unable to delete files from samba share (Windows XP x64 SP2)
Summary: Unable to delete files from samba share (Windows XP x64 SP2)
Status: RESOLVED WORKSFORME
Alias: None
Product: Samba 3.3
Classification: Unclassified
Component: File services (show other bugs)
Version: 3.3.14
Hardware: x64 Windows XP
: P3 critical
Target Milestone: ---
Assignee: Volker Lendecke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-14 03:35 UTC by okmanoj
Modified: 2011-06-08 01:49 UTC (History)
0 users

See Also:


Attachments
Attaching samba logs with level 10 (418.58 KB, application/octet-stream)
2010-10-14 03:37 UTC, okmanoj
no flags Details
Network Capture (959.75 KB, application/zip)
2011-02-28 00:37 UTC, okmanoj
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description okmanoj 2010-10-14 03:35:01 UTC
I found an file deletion issue in samba 3.3.14, below is the description 

Procedure 
1. copy 10 files in samba share.
2. open and close files one by one.
3. after #3 delete closed files

Phenomenon
Some times files are not deleted from samba share when using Windows XP x64 SP2.

Recovery Method
If i erase the content of locking.tdb using tdbtool (without deleting locking.tdb) then i am able to delete the file.

I am getting NT_STATUS_DELETE_PENDING error in network capture. As well as in samba log.

Environment

Samba 3.3.14 running on Linux FC10 
Client PC where File-share has been opened is Windows XP x64 SP2
reproducibility 4/10

From my side i am trying to fix this issue, in the mean time if samba.org can help in this regard then it will be really helpful for me. :)
Comment 1 okmanoj 2010-10-14 03:37:57 UTC
Created attachment 6010 [details]
Attaching samba logs with level 10 

Please find the debug logs. I the attached logs target file which i am trying to delete is "DOC101014-0001.xps"
Comment 2 Volker Lendecke 2010-10-14 03:41:41 UTC
Can you try with 3.5.6? 3.3.14 is not really supported by the Samba Team anymore.

Volker
Comment 3 okmanoj 2010-10-14 03:46:28 UTC
Dear Volkar,

Thank you for the response, I understand.

i will check and update bugzilla with my result.

I was browsing bugzilla and found similar issue #4430 unresolved. 
Comment 4 okmanoj 2010-10-20 20:48:04 UTC
Dear Volker,

With samba 3.5.6 i am not able to delete any files. with this configuration file.

Please let me know if i missed something in configuration.

[global]
workgroup=Workgroup
server string=SMB Server (%L)
netbios name=MANOJLIN12
realm=
log level=3
log file=/home/manoj/sambaInstall/sambalog/samba_%m.log
max log size=64
max smbd processes=13
security=user
password server=
wins support=no
wins proxy=no
dns proxy=no
map to guest=bad user
client ntlmv2 auth=yes
guest account=root
load printers=yes
local master=no
encrypt passwords=yes
deadtime=60


[FILE_SHARE]
path=/storage/sharedfolder
browseable=yes
writeable=no
public=no
guest ok=yes
available=1


Regards,
Manoj
Comment 5 Volker Lendecke 2010-10-22 07:43:33 UTC
Due to "max log size = 64" the log file only contains a very small amount of the things you do. Please for debugging purposes, set "max log size = 0", stop smbd, remove the current log file, start smbd, and re-do the test. It would be great if you could also set

debug hires timestamp = yes

and additionally create a network trace simultaneously. Information on how to create network traces can be found under

http://wiki.samba.org/index.php/Capture_Packets

In particular the log file might become large, but it will shrink significantly if you compress it with bzip2 -9.

Another point: I'm seeing log file messages like

[2010/10/14 16:32:57,  1] locking/locking.c:parse_share_modes(503)
  HAPPY :data.u.s.delete_on_close -> 32
[2010/10/14 16:32:57,  1] locking/locking.c:parse_share_modes(504)
  HAPPY :dbuf.dptr ->
[2010/10/14 16:32:57,  0] locking/locking.c:parse_share_modes(523)
  MANOJ  :: parse_share_modes: delete_on_close: 1, owrt: Thu Oct 14 16:32:45 2010 GMT, cwrt: Thu Jan  1 09:00:00 1970 GMT, tok: 36, num_share_modes: 3

which I don't know where they come from, they are not in standard Samba. Please do your tests with a fresh compile of upstream 3.5.6.

Thanks,

Volker
Comment 6 okmanoj 2011-02-28 00:37:47 UTC
Created attachment 6272 [details]
Network Capture 

Password protected archive 
Password = 123456
Comment 7 okmanoj 2011-02-28 01:41:42 UTC
Dear Volker,

Sorry for making you wait for long time,

I have Attached network capture "sambaFileDeletionCapture.zip" password for the capture is 123456

Also Uploaded my logs in below sharing site (Since logs size is more, I cannot upload the same in Bugzilla)
<code>
http://www.box.net/shared/4ruu2orttz
</code>

In My environment User will not have any write/edit file permission. User can only browse/delete existing files.

Observation : Once this issue happened, file descriptor for thet file is still open, If I erase locking.tdb and try to delete file will get deleted.

I am getting error NT_STATUS_DELETE_PENDING (This error is obvious if file is not closed properly, if i am correct).

I am trying to open and close files from only one WIN-XP-Sp2 client, also from same samba share (without closing Fileshare i am opening and closing file)

MY config File Looks as below

[global]
workgroup=Workgroup
server string=SMB Server (%L)
netbios name=TESTSAMBA
realm=
log level=100
log file=%$(AL_NET_LOG)/samba_%m.log
max log size=0
max smbd processes=13
security=user
password server=
wins support=no
wins proxy=no
dns proxy=no
wins server=172.16.100.6
DeviceAuthTimeout=60
map to guest=bad user
client ntlmv2 auth=yes
guest account=root
load printers=yes
printcap name=/etc/printcap
printing=lprng
local master=no
encrypt passwords=yes
deadtime=60
server signing=auto
client signing=auto

[FILE_SHARE]
path=/storage/sharedfolder
browseable=yes
writeable=no
public=no
guest ok=yes
available=1

Please let me know if you need more information.

Regards
Manoj
Comment 8 okmanoj 2011-02-28 01:44:41 UTC
Due to some issues i cannot use samba 3.5.6, i have attached logs for Samba 3.3.14.

It will be really helpful if you can tell me the issue and some work-around to avoid this situation.

This issue can be reproduces easily.

Very sorry for not using latest samba version.

Regards
Manoj
Comment 9 okmanoj 2011-02-28 01:53:49 UTC
Also I cannot open the file further.

Uploaded screen shots for the same in  http://www.box.net/shared/4ruu2orttz

Regards
Manoj
Comment 10 okmanoj 2011-03-03 02:30:19 UTC
Dear Volker,

While further study of ethereal, we found packet number 2571 (with FID 0x1175) in attached capture doesn't have any close request.

Immediately after packet 2751 I can see close req/resp for FID 0x1729, for this FID creartandxrequest is at packet number 33.

Regards
Manoj

Comment 11 okmanoj 2011-03-08 02:19:00 UTC
Dear Volker,

While further Study, I can see "Query File Internal" info for "Page0006.xps" packet number 2517 as below

SMB:C; Transact2, Query File Info, Query File Internal Info, FID = 0x1774 (\DOC280211\Page0006.xps@#2515)

This packet is not present for any other file deletion (Page0001.xps, Page0002.xps.......Page0005.xps).

My doubt is if Samba is holding resource (File handle) in this query?? If so samba will give delete error in such case.

Please clarify my doubt.

Also can can you help me identifying if this packet is suppose to come or not.

Thank you for spending time with this issue.

Regards
Manoj
Comment 12 okmanoj 2011-06-08 01:49:45 UTC
Unable to reproduce this issue with samba_3.5.8. closing.