nfsv3 & 2.2.9 breaks smbfs (was: Re: smbfs broken in 2.2.9)

Urban Widmark (urban@svenskatest.se)
Mon, 7 Jun 1999 22:33:50 +0200 (CEST)


On Sun, 6 Jun 1999, Alan Cox wrote:

> The way it is called is different however. Look at mm/*.c and fs/*.c diffs.
> The report sounds quite believable as SMBfs probably _should_ have more
> differences for the readpage stuff

Yes, I didn't mean that something wasn't wrong (I am definitly not
qualified to make such statements), I meant that "nothing" had changed in
smbfs. This was true for 2.2.9, but not for the nfs patches.

I have reproduced the problem, after applying what I believe are the
mentioned patches:

http://www.csua.berkeley.edu/~gam3/knfsd/
linux-2.2.9-nfsv3.dif.bz2 ("Trond's nfs v3")
linux-2.2.7-knfsdv3-1.diff (latest, applied cleanly to 2.2.9)
mount-2.9o-nfsv3-0.3.patch (applied cleanly to util-linux-2.9s)

I couldn't find exact matches for the knfsd and mount patches to the
utility versions I had/could find. knfsd-1.3.3b. Steven, is this anywhere
near what you have?

/ss is a nfsv3 mount from localhost, tyr/storage is an automounted smb
share from an NT4SP4.

cola:~>cp /ss/db2setup.log /import/tyr/storage/mnt/
cola:~>ps l 523
FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND
100 0 523 431 0 0 780 348 wait_on_pag D p1 0:00 cp /ss/db

I have only managed to get the 'D' lockup by copying from nfs. The
following all work for me:
touch, echo >, cp /etc/printcap /import/tyr/storage/mnt/

__wait_on_page has a comment "Wait for IO to complete on a locked page",
now, the nfsv3 patch changes smb_updatepage ... it moves some things from
mm/filemap.c, including:
set_bit(PG_locked, &page->flags);

but this flag is never cleared!
(oh, and I needed a number of printk's and reboots to figure that out ...
it looks so easy reading this mail :)

Trond & Steven, I don't have a patch, but here is what I had to change to
stop the blocking.

Change smb_updatepage in fs/smbfs/file.c;
add a
int result;
and change the return from
return smb_writepage_sync(dentry, page, offset, count);
to
result = smb_writepage_sync(dentry, page, offset, count);
smb_unlock_page(page);
return result;

to smb_updatepage in fs/smbfs/file.c.

This also explains why plain 2.2.9 works fine.

/Urban, leaving smbfs & possible readpage problems for some other evening

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/