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 tag '5.8-rc4-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull cifs fixes from Steve French:
"Four cifs/smb3 fixes: the three for stable fix problems found recently
with change notification including a reference count leak"

* tag '5.8-rc4-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
cifs: update internal module version number
cifs: fix reference leak for tlink
smb3: fix unneeded error message on change notify
cifs: remove the retry in cifs_poxis_lock_set
smb3: fix access denied on change notify request to some servers

+22 -18
+1 -1
fs/cifs/cifsfs.h
··· 156 156 extern const struct export_operations cifs_export_ops; 157 157 #endif /* CONFIG_CIFS_NFSD_EXPORT */ 158 158 159 - #define CIFS_VERSION "2.27" 159 + #define CIFS_VERSION "2.28" 160 160 #endif /* _CIFSFS_H */
+6 -13
fs/cifs/file.c
··· 1149 1149 1150 1150 /* 1151 1151 * Set the byte-range lock (posix style). Returns: 1152 - * 1) 0, if we set the lock and don't need to request to the server; 1153 - * 2) 1, if we need to request to the server; 1154 - * 3) <0, if the error occurs while setting the lock. 1152 + * 1) <0, if the error occurs while setting the lock; 1153 + * 2) 0, if we set the lock and don't need to request to the server; 1154 + * 3) FILE_LOCK_DEFERRED, if we will wait for some other file_lock; 1155 + * 4) FILE_LOCK_DEFERRED + 1, if we need to request to the server. 1155 1156 */ 1156 1157 static int 1157 1158 cifs_posix_lock_set(struct file *file, struct file_lock *flock) 1158 1159 { 1159 1160 struct cifsInodeInfo *cinode = CIFS_I(file_inode(file)); 1160 - int rc = 1; 1161 + int rc = FILE_LOCK_DEFERRED + 1; 1161 1162 1162 1163 if ((flock->fl_flags & FL_POSIX) == 0) 1163 1164 return rc; 1164 1165 1165 - try_again: 1166 1166 cifs_down_write(&cinode->lock_sem); 1167 1167 if (!cinode->can_cache_brlcks) { 1168 1168 up_write(&cinode->lock_sem); ··· 1171 1171 1172 1172 rc = posix_lock_file(file, flock, NULL); 1173 1173 up_write(&cinode->lock_sem); 1174 - if (rc == FILE_LOCK_DEFERRED) { 1175 - rc = wait_event_interruptible(flock->fl_wait, 1176 - list_empty(&flock->fl_blocked_member)); 1177 - if (!rc) 1178 - goto try_again; 1179 - locks_delete_block(flock); 1180 - } 1181 1174 return rc; 1182 1175 } 1183 1176 ··· 1645 1652 int posix_lock_type; 1646 1653 1647 1654 rc = cifs_posix_lock_set(file, flock); 1648 - if (!rc || rc < 0) 1655 + if (rc <= FILE_LOCK_DEFERRED) 1649 1656 return rc; 1650 1657 1651 1658 if (type & server->vals->shared_lock_type)
+8 -1
fs/cifs/ioctl.c
··· 169 169 unsigned int xid; 170 170 struct cifsFileInfo *pSMBFile = filep->private_data; 171 171 struct cifs_tcon *tcon; 172 + struct tcon_link *tlink; 172 173 struct cifs_sb_info *cifs_sb; 173 174 __u64 ExtAttrBits = 0; 174 175 __u64 caps; ··· 308 307 break; 309 308 } 310 309 cifs_sb = CIFS_SB(inode->i_sb); 311 - tcon = tlink_tcon(cifs_sb_tlink(cifs_sb)); 310 + tlink = cifs_sb_tlink(cifs_sb); 311 + if (IS_ERR(tlink)) { 312 + rc = PTR_ERR(tlink); 313 + break; 314 + } 315 + tcon = tlink_tcon(tlink); 312 316 if (tcon && tcon->ses->server->ops->notify) { 313 317 rc = tcon->ses->server->ops->notify(xid, 314 318 filep, (void __user *)arg); 315 319 cifs_dbg(FYI, "ioctl notify rc %d\n", rc); 316 320 } else 317 321 rc = -EOPNOTSUPP; 322 + cifs_put_tlink(tlink); 318 323 break; 319 324 default: 320 325 cifs_dbg(FYI, "unsupported ioctl\n");
+6 -2
fs/cifs/smb2misc.c
··· 354 354 ((struct smb2_ioctl_rsp *)shdr)->OutputCount); 355 355 break; 356 356 case SMB2_CHANGE_NOTIFY: 357 + *off = le16_to_cpu( 358 + ((struct smb2_change_notify_rsp *)shdr)->OutputBufferOffset); 359 + *len = le32_to_cpu( 360 + ((struct smb2_change_notify_rsp *)shdr)->OutputBufferLength); 361 + break; 357 362 default: 358 - /* BB FIXME for unimplemented cases above */ 359 - cifs_dbg(VFS, "no length check for command\n"); 363 + cifs_dbg(VFS, "no length check for command %d\n", le16_to_cpu(shdr->Command)); 360 364 break; 361 365 } 362 366
+1 -1
fs/cifs/smb2ops.c
··· 2148 2148 2149 2149 tcon = cifs_sb_master_tcon(cifs_sb); 2150 2150 oparms.tcon = tcon; 2151 - oparms.desired_access = FILE_READ_ATTRIBUTES; 2151 + oparms.desired_access = FILE_READ_ATTRIBUTES | FILE_READ_DATA; 2152 2152 oparms.disposition = FILE_OPEN; 2153 2153 oparms.create_options = cifs_create_options(cifs_sb, 0); 2154 2154 oparms.fid = &fid;