* Re: [BUG] smbfs: caching problems
2001-04-01 1:19 [BUG] smbfs: caching problems Xuan Baldauf
@ 2001-04-03 20:06 ` Urban Widmark
2001-04-04 23:00 ` Urban Widmark
1 sibling, 0 replies; 4+ messages in thread
From: Urban Widmark @ 2001-04-03 20:06 UTC (permalink / raw)
To: Xuan Baldauf; +Cc: linux-kernel
On Sun, 1 Apr 2001, Xuan Baldauf wrote:
> Hello,
>
> there is something wrong with smbfs caching which makes my
> applications fail. The behaviour happens with
> linux-2.4.3-pre4 and linux-2.4.3-final.
Any version you know it doesn't happen with? (including 2.2 versions)
> Consider following shell script: (where /mnt/n is a
> smbmounted smb share from a Win98SE box)
Reproducible, but so far only with win98 (SE?). NT4, samba are testing ok
with the sizes I have tried, not sure what that means.
Thanks a lot for providing a testcase.
I have started looking but right now a lot of non-linux things are calling
for attention. If it isn't trivial I may need some time to get around to
it.
(insanely early morning flights to Stockholm and late evening return
flights, work, easter holiday preparations, local community stuff ... and
that was just today.
Sorry, I'm tired and felt like complaining to someone.
Pay no attention to me :)
You may want to consider looking into it yourself, if you need it
fixed quickly.
'tail -f' has previously been depending on smb_revalidate_inode to update
inode information properly (I suspect that one right now, will check
tomorrow. Possibly that smb open/close changes modification times ...
and/or some win95 bug workaround is causing this?)
Enabling verbose debug (select parts perhaps) can be useful.
Adding debug printouts on inode mtime+size.
/Urban
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [BUG] smbfs: caching problems
2001-04-01 1:19 [BUG] smbfs: caching problems Xuan Baldauf
2001-04-03 20:06 ` Urban Widmark
@ 2001-04-04 23:00 ` Urban Widmark
2001-04-05 1:29 ` Xuan Baldauf
1 sibling, 1 reply; 4+ messages in thread
From: Urban Widmark @ 2001-04-04 23:00 UTC (permalink / raw)
To: Xuan Baldauf; +Cc: linux-kernel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1074 bytes --]
On Sun, 1 Apr 2001, Xuan Baldauf wrote:
> there is something wrong with smbfs caching which makes my
> applications fail. The behaviour happens with
> linux-2.4.3-pre4 and linux-2.4.3-final.
>
> Consider following shell script: (where /mnt/n is a
> smbmounted smb share from a Win98SE box)
Try the attached patch, as a workaround.
Not really sure what is happening, but it seems like win98se isn't
updating the filesize immediately (?).
After truncating the file to 0 bytes the server still returns the old size
(516) when asked (smb_proc_getattr). Somewhere that causes something to
keep the pages for the file (smb_revalidate?) or simply be confused on the
length of the file (508).
I don't understand how as vmtruncate should have thrown out the old stuff
already ... maybe the same page is reused and the last bytes (that
shouldn't be in the file) remain from the last write.
It works with NT4 and Samba, they both return the expected 0 bytes after
truncating to 0. refresh = 0 will not ask and instead run with the 0 byte
length that vmtruncate has set.
/Urban
[-- Attachment #2: Type: TEXT/PLAIN, Size: 872 bytes --]
diff -urN -X exclude linux-2.4.3-orig/fs/smbfs/inode.c linux-2.4.3-smbfs/fs/smbfs/inode.c
--- linux-2.4.3-orig/fs/smbfs/inode.c Sat Mar 31 19:11:53 2001
+++ linux-2.4.3-smbfs/fs/smbfs/inode.c Thu Apr 5 00:32:07 2001
@@ -234,9 +234,10 @@
last_sz = inode->i_size;
error = smb_refresh_inode(dentry);
if (error || inode->i_mtime != last_time || inode->i_size != last_sz) {
- VERBOSE("%s/%s changed, old=%ld, new=%ld\n",
+ VERBOSE("%s/%s changed, old=%ld, new=%ld, osz=%ld, sz=%ld\n",
DENTRY_PATH(dentry),
- (long) last_time, (long) inode->i_mtime);
+ (long) last_time, (long) inode->i_mtime,
+ (long) last_sz, (long) inode->i_size);
if (!S_ISDIR(inode->i_mode))
invalidate_inode_pages(inode);
@@ -550,7 +551,7 @@
if (error)
goto out;
vmtruncate(inode, attr->ia_size);
- refresh = 1;
+ refresh = 0;
}
/*
^ permalink raw reply [flat|nested] 4+ messages in thread