From mbp at samba.org Mon Dec 1 16:19:16 2003 From: mbp at samba.org (Martin Pool) Date: Tue Dec 2 13:55:27 2003 Subject: [linux-cifs-client] (no subject) Message-ID: <20031201051916.3BB5C2C04D@lists.samba.org> Mon Dec 1 16:19:16 EST 2003 From mbp at samba.org Mon Dec 1 14:46:59 2003 From: mbp at samba.org (Martin Pool) Date: Tue Dec 2 13:55:27 2003 Subject: [linux-cifs-client] hello Message-ID: Mon Dec 1 14:46:59 EST 2003 From mbp at samba.org Mon Dec 1 14:54:30 2003 From: mbp at samba.org (Martin Pool) Date: Tue Dec 2 13:55:27 2003 Subject: [linux-cifs-client] test of new list Message-ID: Q: Minnesotans ask, "Why aren't there more pharmacists from Alabama?" A: Easy. It's because they can't figure out how to get the little bottles into the typewriter. From mbp at samba.org Mon Dec 1 14:56:30 2003 From: mbp at samba.org (Martin Pool) Date: Tue Dec 2 13:55:27 2003 Subject: [linux-cifs-client] test of new list Message-ID: Your reasoning powers are good, and you are a fairly good planner. From mbp at samba.org Mon Dec 1 13:58:11 2003 From: mbp at samba.org (Martin Pool) Date: Tue Dec 2 13:55:27 2003 Subject: [linux-cifs-client] test of new list Message-ID: Mon Dec 1 13:58:11 EST 2003 From mbp at samba.org Mon Dec 1 16:12:38 2003 From: mbp at samba.org (Martin Pool) Date: Tue Dec 2 13:55:27 2003 Subject: [linux-cifs-client] test of new list Message-ID: All programmers are optimists. Perhaps this modern sorcery especially attracts those who believe in happy endings and fairy godmothers. Perhaps the hundreds of nitty frustrations drive away all but those who habitually focus on the end goal. Perhaps it is merely that computers are young, programmers are younger, and the young are always optimists. But however the selection process works, the result is indisputable: "This time it will surely run," or "I just found the last bug." -- Frederick Brooks, "The Mythical Man Month" From sfrench at us.ibm.com Tue Dec 2 20:39:05 2003 From: sfrench at us.ibm.com (Steven French) Date: Tue Dec 2 20:42:38 2003 Subject: [linux-cifs-client] Welcome and initial cifs vfs testing Message-ID: Welcome to the cifs vfs client mailing list. This list was created for technical discussion and announcements for the new linux cifs vfs client included in the 2.6 Linux Kernel and some Linux distributions (such as UnitedLinux) who have patched the 2.4 version into their 2.4 kernel. The current version submitted to Linus for 2.6 (pending inclusion) is 0.9.9 and is doing fairly well on testing and is much improved. Issues to address still: 1 - Although POSIX comformance is reasonable there are a few subtle problems left e.g. the connectathon "nfs" test suite (posix file api conformance) shows a few minor problems which should be possible in theory to address with cifs (the protocol) with minor changes to cifs (the filesystem implementation). connectathon lock test 7 fails and some of the later parts of the "-s" ("special") tests fail (slightly differently to Windows and Samba servers). Both need additional analysis. 2 - do_mount still needs to be invoked in kernel for "dfs" redirects and an upcall mechanism to a user space daemon thread for resolving dns to ip address needs to be written 3 - spnego encapsulation of Kerberos tickets (and a mechanism to contact pam_mount, pam_kerberos or winbindd to get the service ticket for the target server) needs to be completed so we do not rely solely on NTLM as the preferred authentication mechanism The current version in Samba CVS (for 2.4) is 0.9.9 which needs additional testing. It would be very helpful if someone could script invocation of the common filesystem tests (fsx, connectathon "nfs" test, dbench, iozone, bonnie and fsstress eg) to two or more target mounts (I will mount one to Samba and one to at least one Windows server version) so the regression test for each minor cifs vfs version could be better automated. In general performance of the cifs vfs on 2.6 kernel is good but could approach nfs speeds (Linux nfs v3 is reasonably optimized for performance) with a slightly different better parallelized implementation of cifs_readpages and an implementation of writepages Steve French Senior Software Engineer Linux Technology Center - IBM Austin phone: 512-838-2294 email: sfrench at-sign us dot ibm dot com -------------- next part -------------- HTML attachment scrubbed and removed From linl at xandros.com Fri Dec 5 18:45:15 2003 From: linl at xandros.com (Lin Li) Date: Fri Dec 5 18:49:48 2003 Subject: [linux-cifs-client] name resolution in mount.cifs Message-ID: <3FD0D23B.7020001@xandros.com> I'm using cifs client with samba3.0.0. It seems only using DNS for name resolution. Could it be improved? Thanks, Lin -- Xandros Corporation Simple. Powerful. Linux. Visit us at http://www.xandros.com From smfltc at us.ibm.com Fri Dec 5 21:33:40 2003 From: smfltc at us.ibm.com (Steve French) Date: Sat Dec 6 00:20:21 2003 Subject: [linux-cifs-client] mount.cifs name resolution Message-ID: <1070659999.10021.8.camel@stevef95.austin.ibm.com> > I'm using cifs client with samba3.0.0. It seems only using DNS for > name resolution. Could it be improved? Are you interested in RFC1001 (older Netbios-over-TCP style) name resolution? DNS name resolution, which is what the mount.cifs mount helper does for resolving the server name (ip addresses are also accepted) seemed easier and more widely accepted these days, although with minor changes mount.cifs could do lmhosts style mappings from entries in a file to ip addresses, or with slightly larger changes it could do local subnet RFC1001 broadcasts. A distinct issue is getting it to work with NT4 servers (Windows 2000 or later or Samba currently is the minimum) - since NT4 requires that the SMBNegprot frame be preceeded by an RFC1001 session initialize (and the dummy name "*SMBSERVER" must be used in that frame if the RFC1001 server name is not specified). That change probably is worth it and shouldn't be too hard but whether NT4 supports a modern enough version of the required Transact2 infolevels to handle the current CIFS dialect is an open question. From smfltc at us.ibm.com Fri Dec 5 21:40:24 2003 From: smfltc at us.ibm.com (Steve French) Date: Sat Dec 6 00:20:21 2003 Subject: [linux-cifs-client] truncated directory listings on 2.4 kernel Message-ID: <1070660424.10036.21.camel@stevef95.austin.ibm.com> I noticed truncated directory listings on 2.4.22 kernel with the cifs vfs for a directory larger than about 90 entries or so. I rebuilt with some additional trace code (since the existing trace code showed no errors - I was adding a check to see if the kernel was returning a bad return code on fildir) and have been unable to reproduce the problem. I have not seen this on 2.6 either. I had assumed that the kernel was out of memory and was failing when cifs_readdir called kernel routine filldir for the later entries. Has anyone seen missing directory entries? In the case of 90 entries in a directory only the first 37 were displayed by ls (all 90 were returned by the cifs vfs code), for 127 entries slightly fewer (about 31 were returned by ls). Hasn't failed since. From sfrench at us.ibm.com Mon Dec 8 03:14:30 2003 From: sfrench at us.ibm.com (Steven French) Date: Mon Dec 8 03:15:09 2003 Subject: [linux-cifs-client] Re: [Fwd: [Samba] CAP_UNIX disabling] Message-ID: I just added code to the 2.6 cifs vfs development tree (http://cifs.bkbits.net/linux-2.5cifs) so that you can toggle negotiating Unix extensions off or on (default is on) by setting /proc/fs/cifs/LinuxExtensionsEnabled to 0 (before you mount to the server). This should let you avoid the problem as soon as this is picked up in the 2.6 tree Steve French Senior Software Engineer Linux Technology Center - IBM Austin phone: 512-838-2294 email: sfrench at-sign us dot ibm dot com From lclaudio at conectiva.com.br Mon Dec 8 13:59:23 2003 From: lclaudio at conectiva.com.br (Luis Claudio R. Goncalves) Date: Mon Dec 8 14:01:09 2003 Subject: [linux-cifs-client] truncated directory listings on 2.4 kernel In-Reply-To: <1070660424.10036.21.camel@stevef95.austin.ibm.com> References: <1070660424.10036.21.camel@stevef95.austin.ibm.com> Message-ID: <20031208135922.GA13072@conectiva.com.br> Hello! On Fri, Dec 05, 2003 at 03:40:24PM -0600, Steve French wrote: | I noticed truncated directory listings on 2.4.22 kernel with the cifs | vfs for a directory larger than about 90 entries or so. I rebuilt with | some additional trace code (since the existing trace code showed no | errors - I was adding a check to see if the kernel was returning a bad | return code on fildir) and have been unable to reproduce the problem. I | have not seen this on 2.6 either. I had assumed that the kernel was out | of memory and was failing when cifs_readdir called kernel routine | filldir for the later entries. In my tests, everything worked like a charm. I've used last cifs 2.4 cvs code, kernel 2.4.21+patches and both samba 2.2.8 and samba 3.0. Just for the record, there was a buglet in samba (2.2.2 or 2.2.3 I believe) were samba was truncating dir listing. | Has anyone seen missing directory entries? In the case of 90 entries in | a directory only the first 37 were displayed by ls (all 90 were returned | by the cifs vfs code), for 127 entries slightly fewer (about 31 were | returned by ls). Hasn't failed since. I tested with 90, 91, 160 and 1600 files and directories. []'s Luis -- [ Luis Claudio R. Goncalves lclaudio@conectiva.com.br ] [ Fingerprint: 4FDD B8C4 3C59 34BD 8BE9 2696 7203 D980 A448 C8F8 ] [ Msc has come!!!! - Conectiva HA Team - Gospel User - Linuxer - !Java ] [ Fault Tolerance - Real-Time - Distributed Systems - IECLB - IS 40:31 ] [ LateNite Programmer -- My Utmost for His Highest -- ] From sfrench at us.ibm.com Mon Dec 8 16:39:59 2003 From: sfrench at us.ibm.com (Steven French) Date: Mon Dec 8 16:40:13 2003 Subject: [linux-cifs-client] Re: [Fwd: [Samba] CAP_UNIX disabling] Message-ID: > If you can just get something in the smbmount man page, or samba docs I don't think it is worth mentioning the enhanced mount syntax in the smbmount man pages, since that could be confusing as it does not apply to smbmount (cifs vfs does not need or use smbmount or smbumount or smbmnt). When we were designing cifs vfs, we decided to keep the mount code and the filesystem together in the kernel filesystem module (mostly) rather than separated as smbfs was (since that had caused version mismatch problems and a few other design problems with smbfs). The cifs vfs mount code does not use smbmount, the mount code is mostly in kernel (the rest is in the small utility mount.cifs that is automatically invoked by mount). I will update the mount.cifs man page and add it to the info that I am giving John T. for the Samba Howto Collection (official Samba Admin Guide). Interestingly the selective CAP_UNIX disabling came up more often as a question, not from those worried about uid/gid mapping issues (as you were), but those who want different symlink behavior. Symlinks have been a more difficult question. Jeremy and I need to work through this in the spec and the Samba code early next year but suggestions would be welcome. The CIFS Unix extensions have problems in lack of features/defintions for different symlink behavior - e.g. server vs. client namespace for symlinks, symlink security issues etc. This is a big issue as some expect NFS behavior and seem expect Windows like reparse/junction behavior and some want symlinks to be invisible to the client. Steve French Senior Software Engineer Linux Technology Center - IBM Austin phone: 512-838-2294 email: sfrench at-sign us dot ibm dot com -------------- next part -------------- HTML attachment scrubbed and removed From linl at xandros.com Mon Dec 8 19:07:36 2003 From: linl at xandros.com (Lin Li) Date: Mon Dec 8 19:12:35 2003 Subject: [linux-cifs-client] mount/umount cifs with normal user Message-ID: <3FD4CBF8.70505@xandros.com> I meet some problem mount/umount cifs with a normal user (non-root). It seems there is a bug in mount.cifs.c which makes setuid check fail. Here is my patch: ------------------------------------------------------ --- mount.cifs.c 30 Sep 2003 15:29:05 -0000 1.3 +++ mount.cifs.c 8 Dec 2003 16:04:44 -0000 @@ -490,7 +490,7 @@ } if((getuid() != 0) && (geteuid() == 0)) { - if((statbuf.st_uid == getuid()) && (S_IRWXU == statbuf.st_mode & S_IRWXU)) { + if((statbuf.st_uid == getuid()) && (S_IRWXU == (statbuf.st_mode & S_IRWXU))) { printf("setuid mount allowed\n"); } else { printf("mount error: permission denied, not superuser and cifs.mount not installed SUID\n"); ------------------------------------------------------ Also, it misses an umount utility similar to smbumount. In the code of smbumount, it uses ioctl(fid, SMB_IOC_GETMOUNTUID, &mount_uid) to check if it's a smbfs and if the user matches the mount user. I don't know if there is a similar call for cifs. I'm going to write some code which checks mounted file system based on the entries in the mtab and check the user using stat on the mount point. Any suggestions? Thanks, Lin -- Xandros Corporation Simple. Powerful. Linux. Visit us at http://www.xandros.com From lintojm at yahoo.com Wed Dec 10 09:54:33 2003 From: lintojm at yahoo.com (L.J.Mathew) Date: Wed Dec 10 09:55:00 2003 Subject: [linux-cifs-client] Problems while i copying folder. Message-ID: <20031210095433.87822.qmail@web40204.mail.yahoo.com> Hi all, I downloaded Kernal-2.4.23 and applied cifs_24.patch to it. I configured it with cifs module support and compiled kernel and modules. Now the new kernel and modules are running fine. I am using Samba-3.0.0. I shared my /home directory. smb.conf -------- [home] path = /home writeable = yes valid users = focuz8 I mounted /home to /mnt using mount.cifs //localhost/home /mnt -o user=focuz8,pass=XXXXXX it mounted successfully. Then i changed my pwd to /mnt/ My /mnt contains many folders . Let it be AAA ,BBB,CCC, etc. Again I changed my pwd to /mnt/AAA. When i tried to copy BBB to AAA, the system hanged! # pwd /mnt/AAA # cp ../BBB . Can any one help me? When I tried the same using 'smbfs' it is working. Thanks in advance, Linto. __________________________________ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ From sfrench at us.ibm.com Wed Dec 10 15:38:48 2003 From: sfrench at us.ibm.com (Steven French) Date: Wed Dec 10 15:40:46 2003 Subject: [linux-cifs-client] Problems while i copying folder. Message-ID: > I configured it with cifs module support and compiled kernel and modules. Did you download the cifs files themselves from the web page (which has a somewhat dated version) or extract the more current version from Samba CVS? You can see the version number from the last entry in file fs/cifs/CHANGES Steve French Senior Software Engineer Linux Technology Center - IBM Austin phone: 512-838-2294 email: sfrench at-sign us dot ibm dot com -------------- next part -------------- HTML attachment scrubbed and removed From lintojm at yahoo.com Thu Dec 11 03:49:27 2003 From: lintojm at yahoo.com (L.J.Mathew) Date: Thu Dec 11 03:49:51 2003 Subject: [linux-cifs-client] Problems while i copying folder. In-Reply-To: Message-ID: <20031211034927.1218.qmail@web40203.mail.yahoo.com> > > I configured it with cifs module support and > compiled kernel and > modules. > Did you download the cifs files themselves from the > web page (which has a I downloaded it from http://fi.samba.org/samba/Linux_CIFS_client.html and version number is 0.87. __________________________________ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ From lclaudio at conectiva.com.br Thu Dec 11 11:31:26 2003 From: lclaudio at conectiva.com.br (Luis Claudio R. Goncalves) Date: Thu Dec 11 11:33:32 2003 Subject: [linux-cifs-client] Problems while i copying folder. In-Reply-To: <20031211034927.1218.qmail@web40203.mail.yahoo.com> References: <20031211034927.1218.qmail@web40203.mail.yahoo.com> Message-ID: <20031211113126.GA25935@conectiva.com.br> On Wed, Dec 10, 2003 at 07:49:27PM -0800, L.J.Mathew wrote: | > > I configured it with cifs module support and | > compiled kernel and | > modules. | > Did you download the cifs files themselves from the | > web page (which has a | | I downloaded it from | http://fi.samba.org/samba/Linux_CIFS_client.html | and version number is 0.87. Hi! The CVS code is both more stable and more fast (I have no numbers on that but for the changelogs and the impression I got from my tests, this is true). To use the CVS code, type the lines below: cvs -d :pserver:cvs@pserver.samba.org:/cvsroot login cvs -z5 -d :pserver:cvs@pserver.samba.org:/cvsroot co cifsvfs The first command line will prompt you for a password. Press and be happy :) Just for the record: [lclaudio@area51 samba]$ head -1 cifsvfs/fs/cifs/CHANGES Version 0.99 Hugs from Brazil, Luis -- [ Luis Claudio R. Goncalves lclaudio@conectiva.com.br ] [ Fingerprint: 4FDD B8C4 3C59 34BD 8BE9 2696 7203 D980 A448 C8F8 ] [ Msc has come!!!! - Conectiva HA Team - Gospel User - Linuxer - !Java ] [ Fault Tolerance - Real-Time - Distributed Systems - IECLB - IS 40:31 ] [ LateNite Programmer -- My Utmost for His Highest -- ] From smfltc at us.ibm.com Fri Dec 12 00:20:54 2003 From: smfltc at us.ibm.com (Steve French) Date: Fri Dec 12 00:27:03 2003 Subject: [linux-cifs-client] cifs vfs 0.9.9a for 2.4 released to web site Message-ID: <1071188454.21295.18.camel@stevef95.austin.ibm.com> I updated the web site to reflect the current 2.4 version of the cifs vfs (0.9.9a) and if continued testing by the community goes reasonably well will announce to freshmeat etc. I also updated the mount helper in cvs and the one on the web site to include the fix to allow mount suid but solving the user unmount problem is harder. I would like to use the /proc/mounts entry for the mountpoint to be unmounted and look for a string like "mntuid=xx" as a way of letting (the new) umount.cifs utility be able to check the current uid vs. that of the user who mounted to that mount point. umount.cifs would be optional of course - just for those who want to be able to suid umount what they mounted. I am not a big fan of ioctls but if the approach to using /proc/mounts is a bad idea, I will probably have to fall back to adding an ioctl for this. A more pressing problem I would like to solve (suggestions would be VERY welcome) is how to pass the mount return code back from the kernel on failed mounts in 2.4 - it seems that my mount return code gets overwritten by the kernel on the way out - I may be able to overwrite the data area passed into with an "rc=xxx" text string - but I think that that buffer is a dummy buffer too (not sure) so that might not do any good either - that may be a case where an ioctl makes sense but it looks odd (fortunately would only apply to 2.4) to use an ioctl to retrieve "last mount return code" but the only other obvious alternative is to put it in /proc/fs/cifs/ but that looks even worse From linl at xandros.com Fri Dec 12 14:55:17 2003 From: linl at xandros.com (Lin Li) Date: Fri Dec 12 15:00:26 2003 Subject: [linux-cifs-client] Re: cifs vfs 0.9.9a for 2.4 released to web site In-Reply-To: <1071188454.21295.18.camel@stevef95.austin.ibm.com> References: <1071188454.21295.18.camel@stevef95.austin.ibm.com> Message-ID: <3FD9D6D5.6050306@xandros.com> Steve French wrote: >I updated the web site to reflect the current 2.4 version of the cifs >vfs (0.9.9a) and if continued testing by the community goes reasonably >well will announce to freshmeat etc. > >I also updated the mount helper in cvs and the one on the web site to >include the fix to allow mount suid but solving the user unmount problem >is harder. I would like to use the /proc/mounts entry for the >mountpoint to be unmounted and look for a string like "mntuid=xx" as a >way of letting (the new) umount.cifs utility be able to check the >current uid vs. that of the user who mounted to that mount point. >umount.cifs would be optional of course - just for those who want to be >able to suid umount what they mounted. I am not a big fan of ioctls >but if the approach to using /proc/mounts is a bad idea, I will probably >have to fall back to adding an ioctl for this. > >A more pressing problem I would like to solve (suggestions would be VERY >welcome) is how to pass the mount return code back from the kernel on >failed mounts in 2.4 - it seems that my mount return code gets >overwritten by the kernel on the way out - I may be able to overwrite >the data area passed into with an "rc=xxx" text string - but I think >that that buffer is a dummy buffer too (not sure) so that might not do >any good either - that may be a case where an ioctl makes sense but it >looks odd (fortunately would only apply to 2.4) to use an ioctl to >retrieve "last mount return code" but the only other obvious alternative >is to put it in /proc/fs/cifs/ but that looks even worse > > > Does the new version solve the symbolic link problem? It's a serious bug. As the mount helper, there is more improvement needs to be done. I did some changes here: --------------------------------------------------------------------------------------------- --- mount.cifs.c 8 Dec 2003 16:02:55 -0000 1.4 +++ mount.cifs.c 11 Dec 2003 18:43:16 -0000 1.6 @@ -289,6 +289,37 @@ } } +/* Make a canonical pathname from PATH. Returns a freshly malloced string. + It is up the *caller* to ensure that the PATH is sensible. i.e. + canonicalize ("/dev/fd0/.") returns "/dev/fd0" even though ``/dev/fd0/.'' + is not a legal pathname for ``/dev/fd0'' Anything we cannot parse + we return unmodified. */ +static char * +canonicalize (char *path) +{ + char *canonical = malloc (PATH_MAX + 1); + + if (!canonical) { + printf("Error! Not enough memory!\n"); + return NULL; + } + + if (strlen(path) > PATH_MAX) { + printf("Mount point string too long\n"); + return NULL; + } + + if (path == NULL) + return NULL; + + if (realpath (path, canonical)) + return canonical; + + strncpy (canonical, path, PATH_MAX); + canonical[PATH_MAX] = '\0'; + return canonical; +} + static struct option longopts[] = { { "all", 0, 0, 'a' }, { "help", 0, 0, 'h' }, @@ -330,6 +361,7 @@ char * mountpoint; char * options; char * temp; + char *p; int rc,i; int rsize = 0; int wsize = 0; @@ -360,7 +392,7 @@ if(argc < 3) mount_cifs_usage(); share_name = argv[1]; - mountpoint = argv[2]; + mountpoint = canonicalize(argv[2]); /* add sharename in opts string as unc= parm */ while ((c = getopt_long (argc, argv, "afFhilL:no:O:rsU:vVwt:", @@ -503,6 +535,25 @@ return 1; */ if (orgoptions && parse_options(strdup(orgoptions))) return 1; + + if (got_user == 0 && getenv("USER")) { + user_name = malloc(256); + if (user_name) + { + strncpy(user_name, getenv("USER"), 255); + got_user = 1; + + if ((p=strchr(user_name,'%'))) { + *p = 0; + mountpassword = malloc(33); + if (mountpassword) { + strncpy(mountpassword, p+1,32); + got_password = 1; + memset(p+1,'\0',strlen(mountpassword)); + } + } + } + } if(got_user == 0) user_name = getusername(); ---------------------------------------------------------------------------------- As for umount, the /proc/mounts does not has a "mounted_uid=xx" recorded (I'm using 0.8.7a, don't know if it's changed in 0.9.9a). Here is a util I written. Let me know if there is anything wrong. ------------------------------------------------------------------- /* * cifsumount.c * */ #include #include #include #include #include #include #include #include #include static void usage(void) { printf("usage: cifsumount mountpoint\n"); } static int umount_ok(const char *mount_point) { int mounted = 0; FILE* mtab; struct mntent *mnt; struct stat st; if ((mtab = setmntent(MOUNTED, "r")) == NULL) { fprintf(stderr, "Can't open " MOUNTED ": %s\n", strerror(errno)); return 1; } while ((mnt = getmntent(mtab)) != NULL) { if (strcmp(mnt->mnt_type, "cifs") == 0 && strcmp(mnt->mnt_dir, mount_point) == 0) { mounted = 1; break; } } endmntent(mtab); if (!mounted) { fprintf(stderr, "%s probably not cifs-filesystem\n", mount_point); return -1; } if (stat(mount_point, &st) == -1) { fprintf(stderr, "Could not open %s: %s\n", mount_point, strerror(errno)); return -1; } if ((getuid() != 0) && (st.st_uid != getuid())) { fprintf(stderr, "You are not allowed to umount %s\n", mount_point); return -1; } return 0; } /* Make a canonical pathname from PATH. Returns a freshly malloced string. It is up the *caller* to ensure that the PATH is sensible. i.e. canonicalize ("/dev/fd0/.") returns "/dev/fd0" even though ``/dev/fd0/.'' is not a legal pathname for ``/dev/fd0'' Anything we cannot parse we return unmodified. */ static char * canonicalize (char *path) { char *canonical = malloc (PATH_MAX + 1); if (!canonical) { fprintf(stderr, "Error! Not enough memory!\n"); return NULL; } if (strlen(path) > PATH_MAX) { fprintf(stderr, "Mount point string too long\n"); return NULL; } if (path == NULL) return NULL; if (realpath (path, canonical)) return canonical; strncpy (canonical, path, PATH_MAX); canonical[PATH_MAX] = '\0'; return canonical; } int main(int argc, char *argv[]) { int fd; char* mount_point; struct mntent *mnt; FILE* mtab; FILE* new_mtab; if (argc != 2) { usage(); exit(1); } if (geteuid() != 0) { fprintf(stderr, "cifsumount must be installed suid root\n"); exit(1); } mount_point = canonicalize(argv[1]); if (mount_point == NULL) { exit(1); } if (umount_ok(mount_point) != 0) { exit(1); } if (umount(mount_point) != 0) { fprintf(stderr, "Could not umount %s: %s\n", mount_point, strerror(errno)); exit(1); } if ((fd = open(MOUNTED"~", O_RDWR|O_CREAT|O_EXCL, 0600)) == -1) { fprintf(stderr, "Can't get "MOUNTED"~ lock file"); return 1; } close(fd); if ((mtab = setmntent(MOUNTED, "r")) == NULL) { fprintf(stderr, "Can't open " MOUNTED ": %s\n", strerror(errno)); return 1; } #define MOUNTED_TMP MOUNTED".tmp" if ((new_mtab = setmntent(MOUNTED_TMP, "w")) == NULL) { fprintf(stderr, "Can't open " MOUNTED_TMP ": %s\n", strerror(errno)); endmntent(mtab); return 1; } while ((mnt = getmntent(mtab)) != NULL) { if (strcmp(mnt->mnt_dir, mount_point) != 0) { addmntent(new_mtab, mnt); } } endmntent(mtab); if (fchmod (fileno (new_mtab), S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) < 0) { fprintf(stderr, "Error changing mode of %s: %s\n", MOUNTED_TMP, strerror(errno)); exit(1); } endmntent(new_mtab); if (rename(MOUNTED_TMP, MOUNTED) < 0) { fprintf(stderr, "Cannot rename %s to %s: %s\n", MOUNTED, MOUNTED_TMP, strerror(errno)); exit(1); } if (unlink(MOUNTED"~") == -1) { fprintf(stderr, "Can't remove "MOUNTED"~"); return 1; } return 0; } ------------------------------------------------------ Thanks, Lin -- Xandros Corporation Simple. Powerful. Linux. Visit us at http://www.xandros.com From seitz at metadata-systems.com Fri Dec 12 20:59:43 2003 From: seitz at metadata-systems.com (Matt Seitz) Date: Fri Dec 12 20:59:48 2003 Subject: [linux-cifs-client] Re: cifs vfs 0.9.9a for 2.4 released to web site In-Reply-To: <3FD9D6D5.6050306@xandros.com> References: <1071188454.21295.18.camel@stevef95.austin.ibm.com> <3FD9D6D5.6050306@xandros.com> Message-ID: <3FDA2C3F.9020104@metadata-systems.com> Lin Li wrote: > + if (strlen(path) > PATH_MAX) { > + printf("Mount point string too long\n"); > + return NULL; > + } > + > + if (path == NULL) > + return NULL; Shouldn't path be checked for NULL before calling stlrlen(path)? From smfltc at us.ibm.com Tue Dec 16 21:26:17 2003 From: smfltc at us.ibm.com (Steve French) Date: Tue Dec 16 21:31:39 2003 Subject: [linux-cifs-client] cifs causes high system load avg, oopses when unloaded on 2.6.0-test11 Message-ID: <1071609977.1806.27.camel@stevef95.austin.ibm.com> >> Using CIFS causes a very high load average (approx. 12 according to >> After I umout all filesystems (CIFS ones) and then unload the module, >> it oopses (below). >> CC me replies if more information is needed. I don't know if this will fail with the more current (version 0.99 of the 2.6 version of the cifs filesystem) which is at http://us1.samba.org/samba/ftp/cifs-cvs/cifs-0.9.9-2.6kern.tar.gz but I am trying some experiments today to see if I can reproduce something similar artificially. I was concerned about some other oopses and problems in the tcp reconnection logic that are now fixed but are in the much older version 0.94 of the cifs vfs in the linux.bkbits.net/linux-2.5 tree but as 2.6 has been mostly locked down for weeks - test11 is missing at least a dozen key cifs fixes (including stress test fixes and fixes for a few oopses reported by 2.6 users testing more actively over the past couple months), the more recent fs/cifs files (version 0.9.9) are likely to be much better than what is in 2.6-test11 (the gz simply contains the contents of the 0.9.9 version of the fs/cifs directory, rather than a patch (about 15 changesets ahead of 2.6test9,10 or 11). There are no corequisite fixes outside the directory and it can be applied to any of the recent 2.6-test* versions) > Hmm, this unload needs to hand back failure to module unload when it>> > can't nuke inodes etc. I'd suggest not using it as a module for the > time being. I don't see how I could pass failure back on module unload even if I could detect problems freeing the memory associated with cifs's inode cache - there is no place for return code info - see the caller ie the call to mod->exit() in sys_delete_module (about line 735 of kernel/module.c) From wli at holomorphy.com Wed Dec 17 01:02:48 2003 From: wli at holomorphy.com (William Lee Irwin III) Date: Wed Dec 17 01:03:19 2003 Subject: [linux-cifs-client] Re: cifs causes high system load avg, oopses when unloaded on 2.6.0-test11 In-Reply-To: <1071609977.1806.27.camel@stevef95.austin.ibm.com> References: <1071609977.1806.27.camel@stevef95.austin.ibm.com> Message-ID: <20031217010248.GA31393@holomorphy.com> At some point in the past, I wrote: >> Hmm, this unload needs to hand back failure to module unload when it>> >> can't nuke inodes etc. I'd suggest not using it as a module for the >> time being. On Tue, Dec 16, 2003 at 03:26:17PM -0600, Steve French wrote: > I don't see how I could pass failure back on module unload even if I > could detect problems freeing the memory associated with cifs's inode > cache - there is no place for return code info - see the caller ie the > call to mod->exit() in sys_delete_module (about line 735 of > kernel/module.c) Right, the facility isn't there. Maybe making the thing not-unloadable would be the best option for the time being. -- wli From nandu_mane at rediffmail.com Wed Dec 17 04:55:52 2003 From: nandu_mane at rediffmail.com (nandkumar l mane) Date: Wed Dec 17 04:58:24 2003 Subject: [linux-cifs-client] cifs API Message-ID: <20031217045552.32540.qmail@webmail25.rediffmail.com> HTML attachment scrubbed and removed -------------- next part -------------- Hi Everybody, I am new & this is my 1st question. I want to create cifs share on linux & MAC OS X so that windows can access it. Can you plz tell me some APIs to acieve it OR tell me how shild I achieve it . Regards Nandkumar From lclaudio at conectiva.com.br Wed Dec 17 12:21:59 2003 From: lclaudio at conectiva.com.br (Luis Claudio R. Goncalves) Date: Wed Dec 17 12:24:00 2003 Subject: [linux-cifs-client] cifs API In-Reply-To: <20031217045552.32540.qmail@webmail25.rediffmail.com> References: <20031217045552.32540.qmail@webmail25.rediffmail.com> Message-ID: <20031217122159.GD32096@conectiva.com.br> Hi! On Wed, Dec 17, 2003 at 04:55:52AM -0000, nandkumar l mane wrote: | Hi Everybody, | | I am new & this is my 1st question. | I want to create cifs share on linux & MAC OS X so that windows can access it. | Can you plz tell me some APIs to acieve it OR tell me how shild I achieve it . If I got your questions right, you need to use samba and create a share. The "cifs-client" addressed in this list is a client to windows/samba shares. You can use it or the old smbfs to mount the shares, not to export them. To export a windows style share in linux you must use samba. []'s Luis -- [ Luis Claudio R. Goncalves lclaudio@conectiva.com.br ] [ Fingerprint: 4FDD B8C4 3C59 34BD 8BE9 2696 7203 D980 A448 C8F8 ] [ Msc has come!!!! - Conectiva HA Team - Gospel User - Linuxer - !Java ] [ Fault Tolerance - Real-Time - Distributed Systems - IECLB - IS 40:31 ] [ LateNite Programmer -- My Utmost for His Highest -- ] From linl at xandros.com Wed Dec 17 21:08:46 2003 From: linl at xandros.com (Lin Li) Date: Wed Dec 17 21:12:14 2003 Subject: [linux-cifs-client] Re: cifs vfs 0.9.9a for 2.4 released to web site In-Reply-To: <1071188454.21295.18.camel@stevef95.austin.ibm.com> References: <1071188454.21295.18.camel@stevef95.austin.ibm.com> Message-ID: <3FE0C5DE.4050407@xandros.com> Steve French wrote: >I updated the web site to reflect the current 2.4 version of the cifs >vfs (0.9.9a) and if continued testing by the community goes reasonably >well will announce to freshmeat etc. > > > On my test system, mount a share as cifs works with 0.8.7a but got a Segment fault with 0.9.9a. Thanks, Lin -- Xandros Corporation Simple. Powerful. Linux. Visit us at http://www.xandros.com From lclaudio at conectiva.com.br Mon Dec 22 20:26:20 2003 From: lclaudio at conectiva.com.br (Luis Claudio R. Goncalves) Date: Mon Dec 22 20:28:28 2003 Subject: [linux-cifs-client] Some benchmarks and ideas Message-ID: <20031222202619.GD2566@conectiva.com.br> Hi! Playing with cifs 0.99a, samba3 and dbench I got the following results: [root@gus sandbox]# dbench 1 1 clients started 0 62477 3.68 MB/sec Throughput 3.68239 MB/sec 1 procs [root@gus sandbox]# [root@gus sandbox]# dbench 2 2 clients started 0 62477 4.14 MB/secc Throughput 4.14458 MB/sec 2 procs [root@gus sandbox]# dbench 4 4 clients started 4 399 0.03 MB/sec The system stall right at the beginning and after 10 minutes you see the same data on screen and several error messages in the log. The most common messages where "Send error on write" and "Send error on Close". Repeating the test with dbench 5 our more iterations I always get the same result but usually a bit faster: [root@gus sandbox]# [root@gus sandbox]# dbench 5 5 clients started write failed on handle 13786 5 47 0.00 MB/sec I repeated these tests form dbench 1 to dbench 10 (the whole set of tests) 10 times and the results are always the same. More than 3 iterations, the cifs mount stalls. Besides the numbers meaning a higher load to the system (dbench 10 means more than 10x the load of dbench1), in the point where the system stalls, right at the begining, it sounds like the number of processes actively writing to a cifs mount is the trigger to some bug. I haven't dived deeply in the internals of cifsvfs, but it can be a good thing to look for. Regards, Luis -- [ Luis Claudio R. Goncalves lclaudio@conectiva.com.br ] [ Fingerprint: 4FDD B8C4 3C59 34BD 8BE9 2696 7203 D980 A448 C8F8 ] [ Msc has come!!!! - Conectiva HA Team - Gospel User - Linuxer - !Java ] [ Fault Tolerance - Real-Time - Distributed Systems - IECLB - IS 40:31 ] [ LateNite Programmer -- My Utmost for His Highest -- ] From sfrench at us.ibm.com Mon Dec 22 21:15:22 2003 From: sfrench at us.ibm.com (Steven French) Date: Mon Dec 22 21:16:00 2003 Subject: [linux-cifs-client] Re: cifs vfs 0.9.9a for 2.4 released to web site Message-ID: Could you send me the dmesg (output /var/log/messages) and if you can the ksymoops info? Steve French Senior Software Engineer Linux Technology Center - IBM Austin phone: 512-838-2294 email: sfrench at-sign us dot ibm dot com -------------- next part -------------- HTML attachment scrubbed and removed From David.Collier-Brown at Sun.COM Tue Dec 23 12:55:34 2003 From: David.Collier-Brown at Sun.COM (David Collier-Brown) Date: Tue Dec 23 12:56:21 2003 Subject: [linux-cifs-client] Samba and Gnome vs Windows AD Message-ID: <3FE83B46.9020708@Sun.COM> I and some of my colleagues are working with the Suse-based Sun Java Desktop, and found that the version of the smb:// vfs module we shipped works with Samba, but not with AD servers. I have three questions: 0) is this appropriate right list? 1) is there a corresponding Gnome list 2) anyone here contributing to the Samba side of the vfs work? I will also have a qustion for them about rolling forward to the newest Samba and smb:// vfs. [many lines of description elided (;-)] --dave -- David Collier-Brown, | Always do right. This will gratify Sun Microsystems, | some people and astonish the rest. Toronto, Ontario, | -- Mark Twain (905) 415-2849 or x52849 | davecb@canada.sun.com From rrothbe at emory.edu Tue Dec 23 15:05:04 2003 From: rrothbe at emory.edu (Robert Rothberg) Date: Tue Dec 23 15:05:15 2003 Subject: [linux-cifs-client] big file transfe Message-ID: <005901c3c966$256fb1b0$04d18caa@crashbox> Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 862 bytes Desc: not available Url : http://lists.samba.org/archive/linux-cifs-client/attachments/20031223/b772945c/attachment.gif From linl at xandros.com Tue Dec 23 16:18:37 2003 From: linl at xandros.com (Lin Li) Date: Tue Dec 23 16:22:20 2003 Subject: [linux-cifs-client] Re: cifs vfs 0.9.9a for 2.4 released to web site In-Reply-To: References: Message-ID: <3FE86ADD.5020607@xandros.com> Steven French wrote: > Could you send me the dmesg (output /var/log/messages) and if you can > the ksymoops info? > > > Steve French > Senior Software Engineer > Linux Technology Center - IBM Austin > phone: 512-838-2294 > email: sfrench at-sign us dot ibm dot com > Before I enabled debug, I got segment fault without any error message when mount and the system froze. I then enabled debug (change the contents of /proc/fs/cifs/cifsFYI to 1) and this time I don't have a segment fault. Here is the message when I use gdb: ------------------------------------------------ Dec 23 10:55:18 Deluxe kernel: connect.c: CIFS VFS: in cifs_mount as Xid: 1 with uid: 0 Dec 23 10:55:18 Deluxe kernel: connect.c: Entering cifs_mount. Xid: 1 with: unc=//2003server1\share,ip=172.16.3.11,pass=Xxxxxxx=1,ver=1,username=2003qa1 Dec 23 10:55:18 Deluxe kernel: connect.c: Username: 2003qa1 Dec 23 10:55:18 Deluxe kernel: connect.c: UNC: \\2003server1\share Dec 23 10:55:18 Deluxe kernel: connect.c: Socket created Dec 23 10:55:18 Deluxe kernel: connect.c: Existing smb sess not found Dec 23 10:55:18 Deluxe kernel: transport.c: For smb_command 114 Dec 23 10:55:18 Deluxe kernel: transport.c: Sending smb of length 47 Dec 23 10:55:18 Deluxe kernel: CIFS VFS: Error -32 sending data on socket to server. Dec 23 10:55:33 Deluxe kernel: transport.c: No response buffer Dec 23 10:55:33 Deluxe kernel: transport.c: marking request for retry Dec 23 10:55:33 Deluxe kernel: misc.c: Null buffer passed to buf_release Dec 23 10:55:33 Deluxe kernel: transport.c: tcp session dead - return to caller to retry Dec 23 10:55:34 Deluxe kernel: connect.c: CIFS VFS: leaving cifs_mount (xid = 1) rc = -112 Dec 23 10:55:34 Deluxe kernel: CIFS VFS: cifs_mount failed w/return code = -112 ------------------------------------------------ And here is the message without gdb: ------------------------------------------------ Dec 23 11:05:35 Deluxe kernel: connect.c: CIFS VFS: in cifs_mount as Xid: 0 with uid: 0 Dec 23 11:05:35 Deluxe kernel: connect.c: Entering cifs_mount. Xid: 0 with: unc=//2003server1\share,ip=172.16.3.11,pass=Xxxxxxx=1,ver=1,username=2003qa1 Dec 23 11:05:35 Deluxe kernel: connect.c: Username: 2003qa1 Dec 23 11:05:35 Deluxe kernel: connect.c: UNC: \\2003server1\share Dec 23 11:05:35 Deluxe kernel: connect.c: Socket created Dec 23 11:05:35 Deluxe kernel: connect.c: Existing smb sess not found Dec 23 11:05:35 Deluxe kernel: transport.c: For smb_command 114 Dec 23 11:05:35 Deluxe kernel: transport.c: Sending smb of length 47 Dec 23 11:05:35 Deluxe kernel: CIFS VFS: Error -32 sending data on socket to server. Dec 23 11:05:35 Deluxe kernel: connect.c: Demultiplex PID: 1056 Dec 23 11:05:35 Deluxe kernel: connect.c: tcp session abended prematurely (after SMBnegprot) Dec 23 11:05:35 Deluxe kernel: CIFS VFS: Active MIDs in queue while exiting - can not delete mid_q_entries or TCP_Server_Info structure due to pending requests MEMORY LEAK!! Dec 23 11:05:35 Deluxe kernel: connect.c: About to exit from demultiplex thread Dec 23 11:05:50 Deluxe kernel: transport.c: No response buffer Dec 23 11:05:50 Deluxe kernel: transport.c: marking request for retry Dec 23 11:05:50 Deluxe kernel: misc.c: Null buffer passed to buf_release Dec 23 11:05:50 Deluxe kernel: transport.c: tcp session dead - return to caller to retry Dec 23 11:05:50 Deluxe kernel: connect.c: CIFS VFS: leaving cifs_mount (xid = 0) rc = -112 Dec 23 11:05:50 Deluxe kernel: CIFS VFS: cifs_mount failed w/return code = -112 ------------------------------------------------ Thanks, Lin -- Xandros Corporation Simple. Powerful. Linux. Visit us at http://www.xandros.com