[linux-cifs-client] CIFS renaming problem with KMail and dot files
Juergen Pfennig
info at j-pfennig.de
Thu Jan 4 20:08:28 GMT 2007
Hi,
with debian etch kernel 2.6.18 and samba 3.0.23d using kde 3.3.5
(1) kMail (via cifs unix-extensions-enabled share) produces strange
files where the filename starts with "cifs" or ".cifs" followed
by a decimal number. This is reproduceable.
(2) Under rare circumstances such files may be created with other
software. I have no idea how to reproduce this.
Could this happen in a client side call like ...
rename("/data/home/jpf/Profiles/Mail/.trash.index.temp",
"/data/home/jpf/Profiles/Mail/.trash.index")
if (a) the target exists and (b) the target is still open?
Yours
Jürgen
Details ...
The symptom (here an "ls -il /home/jpf/Profiles/Mail" on the server):
41002 drwxr-x--- 7 jpf centauri 520 2007-01-04 20:37 .
11115 drwxrwx--- 6 jpf centauri 224 2006-12-06 17:09 ..
35369 drwx------ 5 jpf centauri 120 2007-01-04 20:37 drafts
25029 -rw-r----- 1 jpf centauri 33 2007-01-04 20:37 .drafts.index
28072 -rw-r----- 1 jpf centauri 33 2007-01-04 20:37 .drafts.index.ids
...
36195 drwx------ 5 jpf centauri 120 2007-01-04 20:37 trash
39845 -rw-r----- 1 jpf centauri 1429 2007-01-04 20:37 .trash.index
39843 -rw-r----- 1 jpf centauri 45 2007-01-04 20:37 .trash.index.ids
And after emptying kMails Trash folder ...
41002 drwxr-x--- 7 jpf centauri 544 2007-01-04 20:37 .
11115 drwxrwx--- 6 jpf centauri 224 2006-12-06 17:09 ..
39845 -rw-r----- 1 jpf centauri 1429 2007-01-04 20:37 cifs10d7 <-- HERE !
35369 drwx------ 5 jpf centauri 120 2007-01-04 20:37 drafts
25029 -rw-r----- 1 jpf centauri 33 2007-01-04 20:37 .drafts.index
28072 -rw-r----- 1 jpf centauri 33 2007-01-04 20:37 .drafts.index.ids
...
36195 drwx------ 5 jpf centauri 120 2007-01-04 20:37 trash
39844 -rw-r----- 1 jpf centauri 33 2007-01-04 20:37 .trash.index
39843 -rw-r----- 1 jpf centauri 33 2007-01-04 20:37 .trash.index.ids
What kMail does (excerpt from strace) ...
[pid 11022] lstat64("/data/home/jpf/Profiles/Mail/.trash.index.sorted",
{st_mode=S_IFREG|0640, st_size=1005, ...}) = 0
[pid 11022] lstat64("/data/home/jpf/Profiles/Mail/.trash.index.ids",
{st_mode=S_IFREG|0640, st_size=161, ...}) = 0
[pid 11022] lstat64("/data/home/jpf/Profiles/Mail/.trash.index",
{st_mode=S_IFREG|0640, st_size=15937, ...}) = 0
[pid 11022] access("/data/home/jpf/Profiles/Mail/.trash.index", F_OK) = 0
[pid 11022] access("/data/home/jpf/Profiles/Mail/.trash.index.ids", F_OK) = 0
[pid 11022] lstat64("/data/home/jpf/Profiles/Mail/.trash.index.ids",
{st_mode=S_IFREG|0640, st_size=161, ...}) = 0
[pid 11022] lstat64("/data/home/jpf/Profiles/Mail/.trash.index",
{st_mode=S_IFREG|0640, st_size=15937, ...}) = 0
[pid 11022] open("/data/home/jpf/Profiles/Mail/.trash.index.ids", O_RDWR|
O_LARGEFILE) = 10
[pid 11022] access("/data/home/jpf/Profiles/Mail/.trash.index", F_OK) = 0
[pid 11022] lstat64("/data/home/jpf/Profiles/Mail/.trash.index",
{st_mode=S_IFREG|0640, st_size=15937, ...}) = 0
[pid 11022] open("/data/home/jpf/Profiles/Mail/.trash.index", O_RDWR|
O_LARGEFILE) = 15
[pid 11022] utime("/data/home/jpf/Profiles/Mail/.trash.index", NULL) = 0
[pid 11022] utime("/data/home/jpf/Profiles/Mail/.trash.index.ids", NULL) = 0
[pid 11022] open("/data/home/jpf/Profiles/Mail/.trash.index.sorted", O_RDWR|
O_LARGEFILE) = 16
[pid 11022] unlink("/data/home/jpf/Profiles/Mail/.trash.index.sorted") = 0
[pid 11022] unlink("/data/home/jpf/Profiles/Mail/.trash.index.temp") = -1
ENOENT (No such file or directory)
[pid 11022] open("/data/home/jpf/Profiles/Mail/.trash.index.temp", O_WRONLY|
O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 16
[pid 11022]
rename("/data/home/jpf/Profiles/Mail/.trash.index.temp", "/data/home/jpf/Profiles/Mail/.trash.index")
= 0
[pid 11022] open("/data/home/jpf/Profiles/Mail/.trash.index", O_RDWR|
O_LARGEFILE) = 15
[pid 11022] utime("/data/home/jpf/Profiles/Mail/.trash.index", NULL) = 0
[pid 11022] utime("/data/home/jpf/Profiles/Mail/.trash.index.ids", NULL) = 0
[pid 11022] open("/data/home/jpf/Profiles/Mail/.trash.index.ids", O_RDWR|
O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 16
[pid 11022] truncate64("/data/home/jpf/Profiles/Mail/.trash.index.ids", 33) =
0
[pid 11022] utime("/data/home/jpf/Profiles/Mail/.trash.index", NULL) = 0
[pid 11022] utime("/data/home/jpf/Profiles/Mail/.trash.index.ids", NULL) = 0
[pid 11022] open("/data/home/jpf/Profiles/Mail/.trash.index.ids", O_RDWR|
O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 10
[pid 11022] truncate64("/data/home/jpf/Profiles/Mail/.trash.index.ids", 33) =
0
P.S.
I still remember that, some decades ago, MS-Dos Version 3 or 4 crashed when
renaming open files. Things do repeat!
More information about the linux-cifs-client
mailing list