Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
[CIFS] report rename failure when target file is locked by Windows
[CIFS] Allow null user connections
[CIFS] Fix readdir breakage when blocksize set too small

+29 -6
+5
fs/cifs/CHANGES
··· 1 1 Version 1.46 2 2 ------------ 3 3 Support deep tree mounts. Better support OS/2, Win9x (DOS) time stamps. 4 + Allow null user to be specified on mount ("username="). Do not return 5 + EINVAL on readdir when filldir fails due to overwritten blocksize 6 + (fixes FC problem). Return error in rename 2nd attempt retry (ie report 7 + if rename by handle also fails, after rename by path fails, we were 8 + not reporting whether the retry worked or not). 4 9 5 10 Version 1.45 6 11 ------------
+6 -1
fs/cifs/connect.c
··· 822 822 } else if (strnicmp(data, "nouser_xattr",12) == 0) { 823 823 vol->no_xattr = 1; 824 824 } else if (strnicmp(data, "user", 4) == 0) { 825 - if (!value || !*value) { 825 + if (!value) { 826 826 printk(KERN_WARNING 827 827 "CIFS: invalid or missing username\n"); 828 828 return 1; /* needs_arg; */ 829 + } else if(!*value) { 830 + /* null user, ie anonymous, authentication */ 831 + vol->nullauth = 1; 829 832 } 830 833 if (strnlen(value, 200) < 200) { 831 834 vol->username = value; ··· 1645 1642 /* BB fixme parse for domain name here */ 1646 1643 cFYI(1, ("Username: %s ", volume_info.username)); 1647 1644 1645 + } else if (volume_info.nullauth) { 1646 + cFYI(1,("null user")); 1648 1647 } else { 1649 1648 cifserror("No username specified"); 1650 1649 /* In userspace mount helper we can get user name from alternate
+9 -5
fs/cifs/inode.c
··· 885 885 kmalloc(2 * sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL); 886 886 if (info_buf_source != NULL) { 887 887 info_buf_target = info_buf_source + 1; 888 - rc = CIFSSMBUnixQPathInfo(xid, pTcon, fromName, 889 - info_buf_source, cifs_sb_source->local_nls, 890 - cifs_sb_source->mnt_cifs_flags & 891 - CIFS_MOUNT_MAP_SPECIAL_CHR); 888 + if (pTcon->ses->capabilities & CAP_UNIX) 889 + rc = CIFSSMBUnixQPathInfo(xid, pTcon, fromName, 890 + info_buf_source, 891 + cifs_sb_source->local_nls, 892 + cifs_sb_source->mnt_cifs_flags & 893 + CIFS_MOUNT_MAP_SPECIAL_CHR); 894 + /* else rc is still EEXIST so will fall through to 895 + unlink the target and retry rename */ 892 896 if (rc == 0) { 893 897 rc = CIFSSMBUnixQPathInfo(xid, pTcon, toName, 894 898 info_buf_target, ··· 941 937 cifs_sb_source->mnt_cifs_flags & 942 938 CIFS_MOUNT_MAP_SPECIAL_CHR); 943 939 if (rc==0) { 944 - CIFSSMBRenameOpenFile(xid, pTcon, netfid, toName, 940 + rc = CIFSSMBRenameOpenFile(xid, pTcon, netfid, toName, 945 941 cifs_sb_source->local_nls, 946 942 cifs_sb_source->mnt_cifs_flags & 947 943 CIFS_MOUNT_MAP_SPECIAL_CHR);
+9
fs/cifs/readdir.c
··· 896 896 tmp_inode->i_ino,obj_type); 897 897 if(rc) { 898 898 cFYI(1,("filldir rc = %d",rc)); 899 + /* we can not return filldir errors to the caller 900 + since they are "normal" when the stat blocksize 901 + is too small - we return remapped error instead */ 902 + rc = -EOVERFLOW; 899 903 } 900 904 901 905 dput(tmp_dentry); ··· 1078 1074 we want to check for that here? */ 1079 1075 rc = cifs_filldir(current_entry, file, 1080 1076 filldir, direntry, tmp_buf, max_len); 1077 + if(rc == -EOVERFLOW) { 1078 + rc = 0; 1079 + break; 1080 + } 1081 + 1081 1082 file->f_pos++; 1082 1083 if(file->f_pos == 1083 1084 cifsFile->srch_inf.index_of_last_entry) {