NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: rump vs. smbfs



On Fri, Jan 30, 2009 at 11:33:55PM +0000, Matthias Scheler wrote:
[...]
> I've tried "mount_smbfs" which worked fine. But I got "invalid argument"
> when I tried to "ls -l" on the mount SMB share which seems to be an
> old problem, please look here:
> 
> http://mail-index.netbsd.org/current-users/2004/03/12/0005.html

Hi,

I just got hit by the same problem with a CIFS export from a NetApp
filer ...

njoly@lanfeust [~]> sudo mount_smbfs -I xxx.pasteur.fr -u njoly //njoly@xxx/sis 
/mnt 
Password:
njoly@lanfeust [~]> df -h /mnt
Filesystem            Size       Used      Avail %Cap Mounted on
//NJOLY@XXX/SIS      1.2T       1.1T        82G  93% /mnt
njoly@lanfeust [~]> ls /mnt/njoly
ls: mnt: Invalid argument

  2519      1 ls       CALL  open(0x7f7ffd803400,4,0x7f7ffd80b100)
  2519      1 ls       NAMI  "/mnt/njoly"
  2519      1 ls       RET   open -1 errno 22 Invalid argument

Not sure if this the correct fix; but the attached patch, make open(2)
work again for directories.

njoly@lanfeust [~]> ls -l /mnt/njoly
total 98889
drwxr-xr-x  1 njoly  wheel     16384 Jun 18  2004 Calimero
drwxr-xr-x  1 njoly  wheel     16384 May 17  2000 Databases
drwxr-xr-x  1 njoly  wheel     16384 Nov  6  2002 Mail
drwxr-xr-x  1 njoly  wheel     16384 Oct  5  2008 Sequences
[...]
drwxr-xr-x  1 njoly  wheel     16384 Nov 21  2007 lib
drwxr-xr-x  1 njoly  wheel     16384 Jun 26  2007 man
drwxr-xr-x  1 njoly  wheel     16384 Apr 12  2002 share
-rwxr-xr-x  1 njoly  wheel   1256670 Jun 17 18:35 squizz-0.99a.tar.gz
-rwxr-xr-x  1 njoly  wheel      7718 Jun 18 23:02 sys_sched_getaffinity
-rwxr-xr-x  1 njoly  wheel       684 Jun 18 23:01 sys_sched_getaffinity.c

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.
Index: sys/fs/smbfs/smbfs_vnops.c
===================================================================
RCS file: /cvsroot/src/sys/fs/smbfs/smbfs_vnops.c,v
retrieving revision 1.68
diff -u -p -r1.68 smbfs_vnops.c
--- sys/fs/smbfs/smbfs_vnops.c  22 Jun 2009 21:13:50 -0000      1.68
+++ sys/fs/smbfs/smbfs_vnops.c  22 Jun 2009 21:42:36 -0000
@@ -217,7 +217,6 @@ smbfs_open(void *v)
        struct smbnode *np = VTOSMB(vp);
        struct smb_cred scred;
        struct vattr vattr;
-       u_int32_t sv_caps = SMB_CAPS(SSTOVC(np->n_mount->sm_share));
        int error, accmode;
 
        SMBVDEBUG("%.*s,%d\n", (int) np->n_nmlen, np->n_name,
@@ -227,12 +226,8 @@ smbfs_open(void *v)
                return EACCES;
        }
        if (vp->v_type == VDIR) {
-               if ((sv_caps & SMB_CAP_NT_SMBS) == 0) {
-                       np->n_flag |= NOPEN;
-                       return 0;
-               }
-
-               goto do_open;   /* skip 'modified' check */
+               np->n_flag |= NOPEN;
+               return 0;
        }
 
        if (np->n_flag & NMODIFIED) {
@@ -255,7 +250,6 @@ smbfs_open(void *v)
                }
        }
 
-do_open:
        if ((np->n_flag & NOPEN) != 0)
                return 0;
 


Home | Main Index | Thread Index | Old Index