[Note: This has been posted to linux-kernel and was ignored. Since smbfs is maintained by the samba team, I am retrying here] Hi! To maintain and install packages from CD-ROM to my Debian/GNU Linux system, I use Debian's apt package. Since my Linux box is stowed away in a closet, I use an smbfs mount to mount the CD-ROM drive from my Windows desktop machine to the Linux box. This used to work perfectly with kernel 2.0.x. However, kernel 2.2.x seems to have introduced some kind of weird timing problem. When I register a new CD-ROM with apt, I have to call the program "apt-cdrom" with the parameter "add". apt-cdrom umounts the CD-ROM, prompts the user to insert the new CD-ROM into the drive, mounts the CD-ROM and immediately proceeds to read the directory. This first read attempt fails with kernels 2.2.x. I have to disable the umount-mount sequence with the parameter "-m" and have the CD-ROM mounted previously for the CD-ROM registration to work. stracing apt-cdrom shows evidence that the first directory read returns an empty directory even if the mount call that was issued immediately before succeeded. After that failed directory access and the program's termination, the CD-ROM is mounted correctly and can be accessed. I now suspect that the 2.2 series smbfs needs some time after the mount call returned to actually attach the mounted share to the mount point in the local file system. Thus, access attempts issued immediately after the mount fail. Re-booting the system with a 2.0 series kernel (and using the correct smbmount version for the kernel) makes the problem vanish. It can be reproduced with kernel 2.2.12 and 2.2.13 (didn't try any earlier releases though) and even with the latest smbmount from samba 2.0.6pre3. Is this a kernel issue? Any chances to have this fixed in a future version? Greetings Marc -- -------------------------------------- !! No courtesy copies, please !! ----- Marc Haber | " Questions are the | Mailadresse im Header Karlsruhe, Germany | Beginning of Wisdom " | Fon: *49 721 966 32 15 Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29
On Fri, 12 Nov 1999 00:58:14 +1100, hai scritto:>[Note: This has been posted to linux-kernel and was ignored. Since >smbfs is maintained by the samba team, I am retrying here]>I now suspect that the 2.2 series smbfs needs some time after the >mount call returned to actually attach the mounted share to the mountI had the same problem with my nightly backup (smbmount win9x and copy stuff onto linux), I had to add a "sleep x" between smbmount and "cd" to the smbmounted dir. I have 2.2.13, samba-2.0.6 test1 is a dir with some stuff inside (on linux side) =mount -t smb -o guest //GO/C test1 cd test1 ls sleep 1 ls = The first ls shows the linux content of test1, the second ls shows the win9x stuff (smbmounted). So smbmount returns before having mounted the Win9x dir. -- giulioo@tiscalinet.it
On Fri, Nov 12, 1999 at 12:57:55AM +1100, Marc Haber wrote:> [Note: This has been posted to linux-kernel and was ignored. Since > smbfs is maintained by the samba team, I am retrying here]I saw it over on the kernel mailing list but I think it got ignored because no one else is doing quite what you are. Quite frankly, I didn't pay it much attention because I don't use Debian and I have no clue what apt is doing, so your description of the problem wasn't very helpful.> Hi!> To maintain and install packages from CD-ROM to my Debian/GNU Linux > system, I use Debian's apt package. Since my Linux box is stowed away > in a closet, I use an smbfs mount to mount the CD-ROM drive from my > Windows desktop machine to the Linux box.What release of Debian?> This used to work perfectly with kernel 2.0.x. However, kernel 2.2.x > seems to have introduced some kind of weird timing problem.> When I register a new CD-ROM with apt, I have to call the program > "apt-cdrom" with the parameter "add". apt-cdrom umounts the CD-ROM, > prompts the user to insert the new CD-ROM into the drive, mounts the > CD-ROM and immediately proceeds to read the directory. This first read > attempt fails with kernels 2.2.x. I have to disable the umount-mount > sequence with the parameter "-m" and have the CD-ROM mounted > previously for the CD-ROM registration to work. stracing apt-cdrom > shows evidence that the first directory read returns an empty > directory even if the mount call that was issued immediately before > succeeded. After that failed directory access and the program's > termination, the CD-ROM is mounted correctly and can be accessed.> I now suspect that the 2.2 series smbfs needs some time after the > mount call returned to actually attach the mounted share to the mount > point in the local file system. Thus, access attempts issued > immediately after the mount fail.When I just now read this I got a real strong sense of deja-vu. The earlier versions of smbmount in the Samba package (prior to 2.0.2 I believe) did have a timing problem because the smbmount parent process exited after starting the remount child but before the mount was actually accomplished. This created exactly the timing problem you described here. It caused all sorts of havock with autofs. :-) This is actually what originally got me involved with the Samba team in the first place. That being said, however, that should have been fixed with recent versions of smbmount. Some versions had a problem with the remount process bombing out because of a misplaced debugging print but Tridge cleaned that up when he reworked the code going into 2.0.6. AFAIK, there shouldn't be a timing problem remaining, or autofs would be broken AGAIN for smbmounts. I will however, double check this.> Re-booting the system with a 2.0 series kernel (and using the correct > smbmount version for the kernel) makes the problem vanish. It can be > reproduced with kernel 2.2.12 and 2.2.13 (didn't try any earlier > releases though) and even with the latest smbmount from samba > 2.0.6pre3.> Is this a kernel issue? Any chances to have this fixed in a future > version?If it's what I think it is then, no, I don't believe it's a kernel problem. It's an smbmount problem. But it shouldn't be present with 2.0.6pre3. What is your EXACT command line to smbmount (minus account names and passwords, of course). Did you have to change your command parameters to smbmount from previous versions used with the 2.2.x kernels to the 2.0.6 version of smbmount? Reason I ask that is that if you didn't, you either aren't doing what you think you are doing or you haven't changed something you though you had. The 2.0.6 version of smbmount goes back to the "mount compatible" syntax like the older smbmount program used. If you use the syntax from the 1.9.x through 2.0.4 versions of smbmount with the 2.0.6 version of smbmount, you should have gotten an error.> Greetings > Marc> -- > -------------------------------------- !! No courtesy copies, please !! ----- > Marc Haber | " Questions are the | Mailadresse im Header > Karlsruhe, Germany | Beginning of Wisdom " | Fon: *49 721 966 32 15 > Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29-- Michael H. Warfield | (770) 985-6132 | mhw@WittsEnd.com (The Mad Wizard) | (770) 331-2437 | http://www.wittsend.com/mhw/ NIC whois: MHW9 | An optimist believes we live in the best of all PGP Key: 0xDF1DD471 | possible worlds. A pessimist is sure of it!
On Fri, Nov 12, 1999 at 01:33:42AM +1100, Giulio Orsero wrote:> On Fri, 12 Nov 1999 00:58:14 +1100, hai scritto:> >[Note: This has been posted to linux-kernel and was ignored. Since > >smbfs is maintained by the samba team, I am retrying here]> >I now suspect that the 2.2 series smbfs needs some time after the > >mount call returned to actually attach the mounted share to the mount> I had the same problem with my nightly backup (smbmount win9x and copy > stuff onto linux), I had to add a "sleep x" between smbmount and "cd" to > the smbmounted dir.> I have 2.2.13, samba-2.0.6> test1 is a dir with some stuff inside (on linux side)> => mount -t smb -o guest //GO/C test1 > cd test1 > ls > sleep 1 > ls > = > The first ls shows the linux content of test1, the second ls shows the > win9x stuff (smbmounted).> So smbmount returns before having mounted the Win9x dir.Oh, I gotta a bad feeling about this... This sounds like the return of the old timing window / race condition...> -- > giulioo@tiscalinet.itMike -- Michael H. Warfield | (770) 985-6132 | mhw@WittsEnd.com (The Mad Wizard) | (770) 331-2437 | http://www.wittsend.com/mhw/ NIC whois: MHW9 | An optimist believes we live in the best of all PGP Key: 0xDF1DD471 | possible worlds. A pessimist is sure of it!
> I had the same problem with my nightly backup (smbmount win9x and copy > stuff onto linux), I had to add a "sleep x" between smbmount and "cd" to > the smbmounted dir.this turned out to be a bug in mount, not smbmount. I have sent a patch to the mount maintainer. A new version should be done shortly. Cheers, Tridge
On Tue, 16 Nov 1999, Andrew Tridgell wrote:> > I had the same problem with my nightly backup (smbmount win9x and copy > > stuff onto linux), I had to add a "sleep x" between smbmount and "cd" to > > the smbmounted dir. > > this turned out to be a bug in mount, not smbmount. > > I have sent a patch to the mount maintainer. A new version should be > done shortly.Actually, I think it is already out. (http://www.uwsg.indiana.edu/hypermail/linux/kernel/9911.1/1221.html) Get the source from: ftp://ftp.win.tue.nl/pub/linux/utils/util-linux/ I have not yet tested this myself however ... Btw, Tridge, I checked Documentation/Changes in the kernel source for the adress to util-linux, and I noticed this (in 2.3.28). SMBfs ==== The 2.0.0 release of Samba: ftp://ftp.samba.org/pub/samba/samba-2.0.0.tar.gz Maybe that should be changed to 2.0.6 now? Also the previous entry on SMBfs that talks about some scripts that were useful with samba < 2.0.5 looks like it needs updating. (Sorry, no patch this time :) /Urban