Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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] cifs_prepare_write was incorrectly rereading page in some cases
[CIFS] Fix set file size to zero when doing chmod to Samba 3.0.26pre
[CIFS] Remove some unused functions/declarations
[CIFS] New file for previous commit
[CIFS] cifs export operations
[CIFS] small piece missing from previous patch
[CIFS] Fix locking problem around some cifs uses of i_size write

+230 -73
+7
fs/cifs/CHANGES
··· 1 + Verison 1.48 2 + ------------ 3 + Fix mtime bouncing around from local idea of last write times to remote time. 4 + Fix hang (in i_size_read) when simultaneous size update of same remote file 5 + on smp system corrupts sequence number. Do not reread unnecessarily partial page 6 + (which we are about to overwrite anyway) when writing out file opened rw. 7 + 1 8 Version 1.47 2 9 ------------ 3 10 Fix oops in list_del during mount caused by unaligned string.
+1 -1
fs/cifs/Makefile
··· 3 3 # 4 4 obj-$(CONFIG_CIFS) += cifs.o 5 5 6 - cifs-objs := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o fcntl.o readdir.o ioctl.o sess.o 6 + cifs-objs := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o fcntl.o readdir.o ioctl.o sess.o export.o
+7 -9
fs/cifs/TODO
··· 18 18 19 19 d) Kerberos/SPNEGO session setup support - (started) 20 20 21 - e) NTLMv2 authentication (mostly implemented) 21 + e) NTLMv2 authentication (mostly implemented - double check 22 + that NTLMv2 signing works, also need to cleanup now unneeded SessSetup code in 23 + fs/cifs/connect.c) 22 24 23 25 f) MD5-HMAC signing SMB PDUs when SPNEGO style SessionSetup 24 26 used (Kerberos or NTLMSSP). Signing alreadyimplemented for NTLM ··· 90 88 time to the client (default time, of now or time 0 is used now for these 91 89 very old servers) 92 90 93 - x) Add support for OS/2 (LANMAN 1.2 and LANMAN2.1 based SMB servers) 91 + x) In support for OS/2 (LANMAN 1.2 and LANMAN2.1 based SMB servers) 92 + need to add ability to set time to server (utimes command) 94 93 95 94 y) Finish testing of Windows 9x/Windows ME server support (started). 96 95 97 - KNOWN BUGS (updated April 29, 2005) 96 + KNOWN BUGS (updated February 26, 2007) 98 97 ==================================== 99 98 See http://bugzilla.samba.org - search on product "CifsVFS" for 100 99 current bug list. ··· 110 107 succeed but still return access denied (appears to be Windows 111 108 server not cifs client problem) and has not been reproduced recently. 112 109 NTFS partitions do not have this problem. 113 - 4) debug connectathon lock test case 10 which fails against 114 - Samba (may be unmappable due to POSIX to Windows lock model 115 - differences but worth investigating). Also debug Samba to 116 - see why lock test case 7 takes longer to complete to Samba 117 - than to Windows. 118 110 119 111 Misc testing to do 120 112 ================== ··· 117 119 types. Try nested symlinks (8 deep). Return max path name in stat -f information 118 120 119 121 2) Modify file portion of ltp so it can run against a mounted network 120 - share and run it against cifs vfs. 122 + share and run it against cifs vfs in automated fashion. 121 123 122 124 3) Additional performance testing and optimization using iozone and similar - 123 125 there are some easy changes that can be done to parallelize sequential writes,
+12 -4
fs/cifs/cifsfs.c
··· 1 1 /* 2 2 * fs/cifs/cifsfs.c 3 3 * 4 - * Copyright (C) International Business Machines Corp., 2002,2004 4 + * Copyright (C) International Business Machines Corp., 2002,2007 5 5 * Author(s): Steve French (sfrench@us.ibm.com) 6 6 * 7 7 * Common Internet FileSystem (CIFS) client ··· 47 47 48 48 #ifdef CONFIG_CIFS_QUOTA 49 49 static struct quotactl_ops cifs_quotactl_ops; 50 - #endif 50 + #endif /* QUOTA */ 51 + 52 + #ifdef CONFIG_CIFS_EXPERIMENTAL 53 + extern struct export_operations cifs_export_ops; 54 + #endif /* EXPERIMENTAL */ 51 55 52 56 int cifsFYI = 0; 53 57 int cifsERROR = 1; ··· 66 62 unsigned int sign_CIFS_PDUs = 1; 67 63 extern struct task_struct * oplockThread; /* remove sparse warning */ 68 64 struct task_struct * oplockThread = NULL; 69 - extern struct task_struct * dnotifyThread; /* remove sparse warning */ 70 - struct task_struct * dnotifyThread = NULL; 65 + /* extern struct task_struct * dnotifyThread; remove sparse warning */ 66 + static struct task_struct * dnotifyThread = NULL; 71 67 static const struct super_operations cifs_super_ops; 72 68 unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE; 73 69 module_param(CIFSMaxBufSize, int, 0); ··· 114 110 115 111 sb->s_magic = CIFS_MAGIC_NUMBER; 116 112 sb->s_op = &cifs_super_ops; 113 + #ifdef CONFIG_CIFS_EXPERIMENTAL 114 + if(experimEnabled != 0) 115 + sb->s_export_op = &cifs_export_ops; 116 + #endif /* EXPERIMENTAL */ 117 117 /* if(cifs_sb->tcon->ses->server->maxBuf > MAX_CIFS_HDR_SIZE + 512) 118 118 sb->s_blocksize = cifs_sb->tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE; */ 119 119 #ifdef CONFIG_CIFS_QUOTA
+2 -2
fs/cifs/cifsfs.h
··· 38 38 /* Functions related to super block operations */ 39 39 /* extern const struct super_operations cifs_super_ops;*/ 40 40 extern void cifs_read_inode(struct inode *); 41 - extern void cifs_delete_inode(struct inode *); 42 - /* extern void cifs_write_inode(struct inode *); *//* BB not needed yet */ 41 + /*extern void cifs_delete_inode(struct inode *);*/ /* BB not needed yet */ 42 + /* extern void cifs_write_inode(struct inode *); */ /* BB not needed yet */ 43 43 44 44 /* Functions related to inodes */ 45 45 extern const struct inode_operations cifs_dir_inode_ops;
+5 -3
fs/cifs/cifsglob.h
··· 525 525 */ 526 526 GLOBAL_EXTERN struct smbUidInfo *GlobalUidList[UID_HASH]; 527 527 528 - GLOBAL_EXTERN struct list_head GlobalServerList; /* BB not implemented yet */ 528 + /* GLOBAL_EXTERN struct list_head GlobalServerList; BB not implemented yet */ 529 529 GLOBAL_EXTERN struct list_head GlobalSMBSessionList; 530 530 GLOBAL_EXTERN struct list_head GlobalTreeConnectionList; 531 531 GLOBAL_EXTERN rwlock_t GlobalSMBSeslock; /* protects list inserts on 3 above */ 532 532 533 533 GLOBAL_EXTERN struct list_head GlobalOplock_Q; 534 534 535 - GLOBAL_EXTERN struct list_head GlobalDnotifyReqList; /* Outstanding dir notify requests */ 536 - GLOBAL_EXTERN struct list_head GlobalDnotifyRsp_Q;/* DirNotify response queue */ 535 + /* Outstanding dir notify requests */ 536 + GLOBAL_EXTERN struct list_head GlobalDnotifyReqList; 537 + /* DirNotify response queue */ 538 + GLOBAL_EXTERN struct list_head GlobalDnotifyRsp_Q; 537 539 538 540 /* 539 541 * Global transaction id (XID) information
+3
fs/cifs/cifspdu.h
··· 220 220 */ 221 221 #define CIFS_NO_HANDLE 0xFFFF 222 222 223 + #define NO_CHANGE_64 0xFFFFFFFFFFFFFFFFULL 224 + #define NO_CHANGE_32 0xFFFFFFFFUL 225 + 223 226 /* IPC$ in ASCII */ 224 227 #define CIFS_IPC_RESOURCE "\x49\x50\x43\x24" 225 228
+1 -1
fs/cifs/cifsproto.h
··· 43 43 #define FreeXid(curr_xid) {_FreeXid(curr_xid); cFYI(1,("CIFS VFS: leaving %s (xid = %d) rc = %d",__FUNCTION__,curr_xid,(int)rc));} 44 44 extern char *build_path_from_dentry(struct dentry *); 45 45 extern char *build_wildcard_path_from_dentry(struct dentry *direntry); 46 - extern void renew_parental_timestamps(struct dentry *direntry); 46 + /* extern void renew_parental_timestamps(struct dentry *direntry);*/ 47 47 extern int SendReceive(const unsigned int /* xid */ , struct cifsSesInfo *, 48 48 struct smb_hdr * /* input */ , 49 49 struct smb_hdr * /* out */ ,
+10
fs/cifs/cifssmb.c
··· 4803 4803 pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_UNIX_BASIC); 4804 4804 pSMB->Reserved4 = 0; 4805 4805 pSMB->hdr.smb_buf_length += byte_count; 4806 + /* Samba server ignores set of file size to zero due to bugs in some 4807 + older clients, but we should be precise - we use SetFileSize to 4808 + set file size and do not want to truncate file size to zero 4809 + accidently as happened on one Samba server beta by putting 4810 + zero instead of -1 here */ 4811 + data_offset->EndOfFile = NO_CHANGE_64; 4812 + data_offset->NumOfBytes = NO_CHANGE_64; 4813 + data_offset->LastStatusChange = NO_CHANGE_64; 4814 + data_offset->LastAccessTime = NO_CHANGE_64; 4815 + data_offset->LastModificationTime = NO_CHANGE_64; 4806 4816 data_offset->Uid = cpu_to_le64(uid); 4807 4817 data_offset->Gid = cpu_to_le64(gid); 4808 4818 /* better to leave device as zero when it is */
+1 -1
fs/cifs/dir.c
··· 31 31 #include "cifs_debug.h" 32 32 #include "cifs_fs_sb.h" 33 33 34 - void 34 + static void 35 35 renew_parental_timestamps(struct dentry *direntry) 36 36 { 37 37 /* BB check if there is a way to get the kernel to do this or if we really need this */
+52
fs/cifs/export.c
··· 1 + /* 2 + * fs/cifs/export.c 3 + * 4 + * Copyright (C) International Business Machines Corp., 2007 5 + * Author(s): Steve French (sfrench@us.ibm.com) 6 + * 7 + * Common Internet FileSystem (CIFS) client 8 + * 9 + * Operations related to support for exporting files via NFSD 10 + * 11 + * This library is free software; you can redistribute it and/or modify 12 + * it under the terms of the GNU Lesser General Public License as published 13 + * by the Free Software Foundation; either version 2.1 of the License, or 14 + * (at your option) any later version. 15 + * 16 + * This library is distributed in the hope that it will be useful, 17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 19 + * the GNU Lesser General Public License for more details. 20 + * 21 + * You should have received a copy of the GNU Lesser General Public License 22 + * along with this library; if not, write to the Free Software 23 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 + */ 25 + 26 + /* 27 + * See Documentation/filesystems/Exporting 28 + * and examples in fs/exportfs 29 + */ 30 + 31 + #include <linux/fs.h> 32 + 33 + #ifdef CONFIG_CIFS_EXPERIMENTAL 34 + 35 + static struct dentry *cifs_get_parent(struct dentry *dentry) 36 + { 37 + /* BB need to add code here eventually to enable export via NFSD */ 38 + return ERR_PTR(-EACCES); 39 + } 40 + 41 + struct export_operations cifs_export_ops = { 42 + .get_parent = cifs_get_parent, 43 + /* Following five export operations are unneeded so far and can default */ 44 + /* .get_dentry = 45 + .get_name = 46 + .find_exported_dentry = 47 + .decode_fh = 48 + .encode_fs = */ 49 + }; 50 + 51 + #endif /* EXPERIMENTAL */ 52 +
+66 -45
fs/cifs/file.c
··· 879 879 cifs_stats_bytes_written(pTcon, total_written); 880 880 881 881 /* since the write may have blocked check these pointers again */ 882 - if (file->f_path.dentry) { 883 - if (file->f_path.dentry->d_inode) { 884 - struct inode *inode = file->f_path.dentry->d_inode; 885 - inode->i_ctime = inode->i_mtime = 886 - current_fs_time(inode->i_sb); 887 - if (total_written > 0) { 888 - if (*poffset > file->f_path.dentry->d_inode->i_size) 889 - i_size_write(file->f_path.dentry->d_inode, 882 + if ((file->f_path.dentry) && (file->f_path.dentry->d_inode)) { 883 + struct inode *inode = file->f_path.dentry->d_inode; 884 + /* Do not update local mtime - server will set its actual value on write 885 + * inode->i_ctime = inode->i_mtime = 886 + * current_fs_time(inode->i_sb);*/ 887 + if (total_written > 0) { 888 + spin_lock(&inode->i_lock); 889 + if (*poffset > file->f_path.dentry->d_inode->i_size) 890 + i_size_write(file->f_path.dentry->d_inode, 890 891 *poffset); 891 - } 892 - mark_inode_dirty_sync(file->f_path.dentry->d_inode); 892 + spin_unlock(&inode->i_lock); 893 893 } 894 + mark_inode_dirty_sync(file->f_path.dentry->d_inode); 894 895 } 895 896 FreeXid(xid); 896 897 return total_written; ··· 1013 1012 cifs_stats_bytes_written(pTcon, total_written); 1014 1013 1015 1014 /* since the write may have blocked check these pointers again */ 1016 - if (file->f_path.dentry) { 1017 - if (file->f_path.dentry->d_inode) { 1015 + if ((file->f_path.dentry) && (file->f_path.dentry->d_inode)) { 1018 1016 /*BB We could make this contingent on superblock ATIME flag too */ 1019 - /* file->f_path.dentry->d_inode->i_ctime = 1020 - file->f_path.dentry->d_inode->i_mtime = CURRENT_TIME;*/ 1021 - if (total_written > 0) { 1022 - if (*poffset > file->f_path.dentry->d_inode->i_size) 1023 - i_size_write(file->f_path.dentry->d_inode, 1024 - *poffset); 1025 - } 1026 - mark_inode_dirty_sync(file->f_path.dentry->d_inode); 1017 + /* file->f_path.dentry->d_inode->i_ctime = 1018 + file->f_path.dentry->d_inode->i_mtime = CURRENT_TIME;*/ 1019 + if (total_written > 0) { 1020 + spin_lock(&file->f_path.dentry->d_inode->i_lock); 1021 + if (*poffset > file->f_path.dentry->d_inode->i_size) 1022 + i_size_write(file->f_path.dentry->d_inode, 1023 + *poffset); 1024 + spin_unlock(&file->f_path.dentry->d_inode->i_lock); 1027 1025 } 1026 + mark_inode_dirty_sync(file->f_path.dentry->d_inode); 1028 1027 } 1029 1028 FreeXid(xid); 1030 1029 return total_written; ··· 1401 1400 xid = GetXid(); 1402 1401 cFYI(1, ("commit write for page %p up to position %lld for %d", 1403 1402 page, position, to)); 1403 + spin_lock(&inode->i_lock); 1404 1404 if (position > inode->i_size) { 1405 1405 i_size_write(inode, position); 1406 1406 /* if (file->private_data == NULL) { ··· 1431 1429 cFYI(1, (" SetEOF (commit write) rc = %d", rc)); 1432 1430 } */ 1433 1431 } 1432 + spin_unlock(&inode->i_lock); 1434 1433 if (!PageUptodate(page)) { 1435 1434 position = ((loff_t)page->index << PAGE_CACHE_SHIFT) + offset; 1436 1435 /* can not rely on (or let) writepage write this data */ ··· 1992 1989 unsigned from, unsigned to) 1993 1990 { 1994 1991 int rc = 0; 1995 - loff_t offset = (loff_t)page->index << PAGE_CACHE_SHIFT; 1996 - cFYI(1, ("prepare write for page %p from %d to %d",page,from,to)); 1997 - if (!PageUptodate(page)) { 1998 - /* if (to - from != PAGE_CACHE_SIZE) { 1999 - void *kaddr = kmap_atomic(page, KM_USER0); 2000 - memset(kaddr, 0, from); 2001 - memset(kaddr + to, 0, PAGE_CACHE_SIZE - to); 2002 - flush_dcache_page(page); 2003 - kunmap_atomic(kaddr, KM_USER0); 2004 - } */ 2005 - /* If we are writing a full page it will be up to date, 2006 - no need to read from the server */ 2007 - if ((to == PAGE_CACHE_SIZE) && (from == 0)) 2008 - SetPageUptodate(page); 1992 + loff_t i_size; 1993 + loff_t offset; 2009 1994 2010 - /* might as well read a page, it is fast enough */ 2011 - if ((file->f_flags & O_ACCMODE) != O_WRONLY) { 2012 - rc = cifs_readpage_worker(file, page, &offset); 2013 - } else { 2014 - /* should we try using another file handle if there is one - 2015 - how would we lock it to prevent close of that handle 2016 - racing with this read? 2017 - In any case this will be written out by commit_write */ 2018 - } 1995 + cFYI(1, ("prepare write for page %p from %d to %d",page,from,to)); 1996 + if (PageUptodate(page)) 1997 + return 0; 1998 + 1999 + /* If we are writing a full page it will be up to date, 2000 + no need to read from the server */ 2001 + if ((to == PAGE_CACHE_SIZE) && (from == 0)) { 2002 + SetPageUptodate(page); 2003 + return 0; 2019 2004 } 2020 2005 2021 - /* BB should we pass any errors back? 2022 - e.g. if we do not have read access to the file */ 2006 + offset = (loff_t)page->index << PAGE_CACHE_SHIFT; 2007 + i_size = i_size_read(page->mapping->host); 2008 + 2009 + if ((offset >= i_size) || 2010 + ((from == 0) && (offset + to) >= i_size)) { 2011 + /* 2012 + * We don't need to read data beyond the end of the file. 2013 + * zero it, and set the page uptodate 2014 + */ 2015 + void *kaddr = kmap_atomic(page, KM_USER0); 2016 + 2017 + if (from) 2018 + memset(kaddr, 0, from); 2019 + if (to < PAGE_CACHE_SIZE) 2020 + memset(kaddr + to, 0, PAGE_CACHE_SIZE - to); 2021 + flush_dcache_page(page); 2022 + kunmap_atomic(kaddr, KM_USER0); 2023 + SetPageUptodate(page); 2024 + } else if ((file->f_flags & O_ACCMODE) != O_WRONLY) { 2025 + /* might as well read a page, it is fast enough */ 2026 + rc = cifs_readpage_worker(file, page, &offset); 2027 + } else { 2028 + /* we could try using another file handle if there is one - 2029 + but how would we lock it to prevent close of that handle 2030 + racing with this read? In any case 2031 + this will be written out by commit_write so is fine */ 2032 + } 2033 + 2034 + /* we do not need to pass errors back 2035 + e.g. if we do not have read access to the file 2036 + because cifs_commit_write will do the right thing. -- shaggy */ 2037 + 2023 2038 return 0; 2024 2039 } 2025 2040
+56 -2
fs/cifs/inode.c
··· 143 143 inode->i_gid = le64_to_cpu(findData.Gid); 144 144 inode->i_nlink = le64_to_cpu(findData.Nlinks); 145 145 146 + spin_lock(&inode->i_lock); 146 147 if (is_size_safe_to_change(cifsInfo, end_of_file)) { 147 148 /* can not safely change the file size here if the 148 149 client is writing to it due to potential races */ 149 - 150 150 i_size_write(inode, end_of_file); 151 151 152 152 /* blksize needs to be multiple of two. So safer to default to ··· 162 162 /* for this calculation */ 163 163 inode->i_blocks = (512 - 1 + num_of_bytes) >> 9; 164 164 } 165 + spin_unlock(&inode->i_lock); 165 166 166 167 if (num_of_bytes < end_of_file) 167 168 cFYI(1, ("allocation size less than end of file")); ··· 497 496 /* BB add code here - 498 497 validate if device or weird share or device type? */ 499 498 } 499 + 500 + spin_lock(&inode->i_lock); 500 501 if (is_size_safe_to_change(cifsInfo, le64_to_cpu(pfindData->EndOfFile))) { 501 502 /* can not safely shrink the file size here if the 502 503 client is writing to it due to potential races */ ··· 509 506 inode->i_blocks = (512 - 1 + le64_to_cpu( 510 507 pfindData->AllocationSize)) >> 9; 511 508 } 509 + spin_unlock(&inode->i_lock); 512 510 513 511 inode->i_nlink = le32_to_cpu(pfindData->NumberOfLinks); 514 512 ··· 838 834 839 835 if (!rc) { 840 836 drop_nlink(inode); 837 + spin_lock(&direntry->d_inode->i_lock); 841 838 i_size_write(direntry->d_inode,0); 842 839 clear_nlink(direntry->d_inode); 840 + spin_unlock(&direntry->d_inode->i_lock); 843 841 } 844 842 845 843 cifsInode = CIFS_I(direntry->d_inode); ··· 1134 1128 return rc; 1135 1129 } 1136 1130 1131 + static int cifs_vmtruncate(struct inode * inode, loff_t offset) 1132 + { 1133 + struct address_space *mapping = inode->i_mapping; 1134 + unsigned long limit; 1135 + 1136 + spin_lock(&inode->i_lock); 1137 + if (inode->i_size < offset) 1138 + goto do_expand; 1139 + /* 1140 + * truncation of in-use swapfiles is disallowed - it would cause 1141 + * subsequent swapout to scribble on the now-freed blocks. 1142 + */ 1143 + if (IS_SWAPFILE(inode)) { 1144 + spin_unlock(&inode->i_lock); 1145 + goto out_busy; 1146 + } 1147 + i_size_write(inode, offset); 1148 + spin_unlock(&inode->i_lock); 1149 + unmap_mapping_range(mapping, offset + PAGE_SIZE - 1, 0, 1); 1150 + truncate_inode_pages(mapping, offset); 1151 + goto out_truncate; 1152 + 1153 + do_expand: 1154 + limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur; 1155 + if (limit != RLIM_INFINITY && offset > limit) { 1156 + spin_unlock(&inode->i_lock); 1157 + goto out_sig; 1158 + } 1159 + if (offset > inode->i_sb->s_maxbytes) { 1160 + spin_unlock(&inode->i_lock); 1161 + goto out_big; 1162 + } 1163 + i_size_write(inode, offset); 1164 + spin_unlock(&inode->i_lock); 1165 + out_truncate: 1166 + if (inode->i_op && inode->i_op->truncate) 1167 + inode->i_op->truncate(inode); 1168 + return 0; 1169 + out_sig: 1170 + send_sig(SIGXFSZ, current, 0); 1171 + out_big: 1172 + return -EFBIG; 1173 + out_busy: 1174 + return -ETXTBSY; 1175 + } 1176 + 1137 1177 int cifs_setattr(struct dentry *direntry, struct iattr *attrs) 1138 1178 { 1139 1179 int xid; ··· 1296 1244 */ 1297 1245 1298 1246 if (rc == 0) { 1299 - rc = vmtruncate(direntry->d_inode, attrs->ia_size); 1247 + rc = cifs_vmtruncate(direntry->d_inode, attrs->ia_size); 1300 1248 cifs_truncate_page(direntry->d_inode->i_mapping, 1301 1249 direntry->d_inode->i_size); 1302 1250 } else ··· 1431 1379 return rc; 1432 1380 } 1433 1381 1382 + #if 0 1434 1383 void cifs_delete_inode(struct inode *inode) 1435 1384 { 1436 1385 cFYI(1, ("In cifs_delete_inode, inode = 0x%p", inode)); 1437 1386 /* may have to add back in if and when safe distributed caching of 1438 1387 directories added e.g. via FindNotify */ 1439 1388 } 1389 + #endif
+5 -1
fs/cifs/readdir.c
··· 3 3 * 4 4 * Directory search handling 5 5 * 6 - * Copyright (C) International Business Machines Corp., 2004, 2005 6 + * Copyright (C) International Business Machines Corp., 2004, 2007 7 7 * Author(s): Steve French (sfrench@us.ibm.com) 8 8 * 9 9 * This library is free software; you can redistribute it and/or modify ··· 226 226 atomic_set(&cifsInfo->inUse, 1); 227 227 } 228 228 229 + spin_lock(&tmp_inode->i_lock); 229 230 if (is_size_safe_to_change(cifsInfo, end_of_file)) { 230 231 /* can not safely change the file size here if the 231 232 client is writing to it due to potential races */ ··· 236 235 /* for this calculation, even though the reported blocksize is larger */ 237 236 tmp_inode->i_blocks = (512 - 1 + allocation_size) >> 9; 238 237 } 238 + spin_unlock(&tmp_inode->i_lock); 239 239 240 240 if (allocation_size < end_of_file) 241 241 cFYI(1, ("May be sparse file, allocation less than file size")); ··· 357 355 tmp_inode->i_gid = le64_to_cpu(pfindData->Gid); 358 356 tmp_inode->i_nlink = le64_to_cpu(pfindData->Nlinks); 359 357 358 + spin_lock(&tmp_inode->i_lock); 360 359 if (is_size_safe_to_change(cifsInfo, end_of_file)) { 361 360 /* can not safely change the file size here if the 362 361 client is writing to it due to potential races */ ··· 367 364 /* for this calculation, not the real blocksize */ 368 365 tmp_inode->i_blocks = (512 - 1 + num_of_bytes) >> 9; 369 366 } 367 + spin_unlock(&tmp_inode->i_lock); 370 368 371 369 if (S_ISREG(tmp_inode->i_mode)) { 372 370 cFYI(1, ("File inode"));
+2 -4
fs/cifs/transport.c
··· 499 499 due to last connection to this server being unmounted */ 500 500 if (signal_pending(current)) { 501 501 /* if signal pending do not hold up user for full smb timeout 502 - but we still give response a change to complete */ 502 + but we still give response a chance to complete */ 503 503 timeout = 2 * HZ; 504 504 } 505 505 ··· 587 587 } 588 588 589 589 out: 590 - 591 590 DeleteMidQEntry(midQ); 592 591 atomic_dec(&ses->server->inFlight); 593 592 wake_up(&ses->server->request_q); ··· 680 681 due to last connection to this server being unmounted */ 681 682 if (signal_pending(current)) { 682 683 /* if signal pending do not hold up user for full smb timeout 683 - but we still give response a change to complete */ 684 + but we still give response a chance to complete */ 684 685 timeout = 2 * HZ; 685 686 } 686 687 ··· 764 765 } 765 766 766 767 out: 767 - 768 768 DeleteMidQEntry(midQ); 769 769 atomic_dec(&ses->server->inFlight); 770 770 wake_up(&ses->server->request_q);