https://bugs.freedesktop.org/show_bug.cgi?id=59022
--- Comment #8 from Lionel Elie Mamane <[email protected]> --- (In reply to comment #7) > trying it with a local file i get first open from type detection > filling the XInputStream in the Media Descriptor: > second open is then to copy the file to a temp-file in SfxMedium: > ... no idea what to do about it, other than perhaps to somehow use the > Media Descriptor stream to create the temp file? Or close the Media Descriptor stream before creating the temp file? Or think again why we need a lock? > i wonder why that used to work in older versions then? Here's the difference I see from the strace: In older versions, the first opened file is not read from before opening the second file. Possibly the lock that is taken is "lazy", as in it is gotten only when actually reading/writing data from/to the file? Actually, the first opened file is *never* read from. So it seems the "XInputStream in the Media Descriptor" is never used in older versions. So my guess is that something changed in type detection, or maybe XInputStream is less lazy? First open (presumed to be type detection) 27360 access("/path/to/filename.odt", F_OK) = 0 27360 access("/path/to/filename.odt", F_OK) = 0 27360 lstat("/path/to/filename.odt", {st_mode=S_IFREG|0600, st_size=42388, ...}) = 0 27360 open("/path/to/filename.odt", O_RDWR|O_EXCL) = 33 27360 fstat(33, {st_mode=S_IFREG|0600, st_size=42388, ...}) = 0 27360 fcntl(33, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0 27360 access("/path/to/filename.odt", F_OK) = 0 27360 lstat("/path/to/filename.odt", {st_mode=S_IFREG|0600, st_size=42388, ...}) = 0 Then a weird dance is done where the lockfile is created as a temporary file and then copied to the actual lockfile (why not write directly to the lockfile?) 27360 open("/tmp/lu1d2lc5.tmp/lu1d2lh1.tmp", O_RDWR|O_EXCL) = 36 27360 fstat(36, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0 27360 fcntl(36, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0 27360 pread(36, "", 4096, 0) = 0 27360 pwrite(36, ",master,camp.domain.gestman.lu,1"..., 90, 0) = 90 27360 close(36) = 0 27360 open("/tmp/lu1d2lc5.tmp/lu1d2lh1.tmp", O_RDWR|O_EXCL) = 36 27360 fstat(36, {st_mode=S_IFREG|0600, st_size=90, ...}) = 0 27360 fcntl(36, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0 27360 open("/path/to/.~lock.filename.odt#", O_RDONLY|O_EXCL) = -1 ENOENT (No such file or directory) 27360 open("/path/to/.~lock.filename.odt#", O_RDWR|O_CREAT|O_EXCL, 0666) = 63 27360 fstat(63, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0 27360 pread(36, ",master,camp.domain.gestman.lu,1"..., 32768, 0) = 90 27360 close(36) = 0 27360 pread(63, "", 4096, 0) = 0 27360 pwrite(63, ",master,camp.domain.gestman.lu,1"..., 90, 0) = 90 27360 close(63) = 0 27360 lstat("/tmp/lu1d2lc5.tmp/lu1d2lh1.tmp", {st_mode=S_IFREG|0600, st_size=90, ...}) = 0 27360 unlink("/tmp/lu1d2lc5.tmp/lu1d2lh1.tmp") = 0 Second open, and read/write: 27360 access("/path/to/filename.odt", F_OK) = 0 27360 lstat("/path/to/filename.odt", {st_mode=S_IFREG|0600, st_size=42388, ...}) = 0 27360 access("/path/to/filename.odt", F_OK) = 0 27360 lstat("/path/to/filename.odt", {st_mode=S_IFREG|0600, st_size=42388, ...}) = 0 27360 access("/tmp/lu1d2lc5.tmp", F_OK) = 0 27360 lstat("/tmp/lu1d2lc5.tmp", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0 27360 access("/path/to/filename.odt", F_OK) = 0 27360 lstat("/path/to/filename.odt", {st_mode=S_IFREG|0600, st_size=42388, ...}) = 0 27360 lstat("/path/to/filename.odt", {st_mode=S_IFREG|0600, st_size=42388, ...}) = 0 27360 open("/path/to/filename.odt", O_RDONLY) = 36 27360 fstat(36, {st_mode=S_IFREG|0600, st_size=42388, ...}) = 0 27360 open("/tmp/lu1d2lc5.tmp/lu1d2lh2.tmp", O_WRONLY|O_CREAT, 0100600) = 63 27360 pread(36, "PK\3\4\24\0\0\10\0\0zC+B^\3062\f'\0\0\0'\0\0\0\10\0\0\0mi"..., 32767, 0) = 32767 27360 write(63, "PK\3\4\24\0\0\10\0\0zC+B^\3062\f'\0\0\0'\0\0\0\10\0\0\0mi"..., 32767) = 32767 27360 pread(36, "\0245\356v\347:|<\242\314\304\343\243(+\3235K~\313\265\226}\342\245\240yN\245\323}\320"..., 9621, 32767) = 9621 27360 write(63, "\0245\356v\347:|<\242\314\304\343\243(+\3235K~\313\265\226}\342\245\240yN\245\323}\320"..., 9621) = 9621 27360 close(36) = 0 27360 close(63) = 0 -- You are receiving this mail because: You are the assignee for the bug.
_______________________________________________ Libreoffice-bugs mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
