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

Configure Feed

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

Merge tag 'v6.11-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client fixes from Steve French:

- fix for clang warning - additional null check

- fix for cached write with posix locks

- flexible structure fix

* tag 'v6.11-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
smb: smb2pdu.h: Use static_assert() to check struct sizes
smb3: fix lock breakage for cached writes
smb/client: avoid possible NULL dereference in cifs_free_subrequest()

+17 -6
+15 -6
fs/smb/client/file.c
··· 316 316 #endif 317 317 } 318 318 319 - if (rdata->credits.value != 0) 319 + if (rdata->credits.value != 0) { 320 320 trace_smb3_rw_credits(rdata->rreq->debug_id, 321 321 rdata->subreq.debug_index, 322 322 rdata->credits.value, ··· 324 324 rdata->server ? rdata->server->in_flight : 0, 325 325 -rdata->credits.value, 326 326 cifs_trace_rw_credits_free_subreq); 327 + if (rdata->server) 328 + add_credits_and_wake_if(rdata->server, &rdata->credits, 0); 329 + else 330 + rdata->credits.value = 0; 331 + } 327 332 328 - add_credits_and_wake_if(rdata->server, &rdata->credits, 0); 329 333 if (rdata->have_xid) 330 334 free_xid(rdata->xid); 331 335 } ··· 2754 2750 struct inode *inode = file->f_mapping->host; 2755 2751 struct cifsInodeInfo *cinode = CIFS_I(inode); 2756 2752 struct TCP_Server_Info *server = tlink_tcon(cfile->tlink)->ses->server; 2753 + struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 2757 2754 ssize_t rc; 2758 2755 2759 2756 rc = netfs_start_io_write(inode); ··· 2771 2766 if (rc <= 0) 2772 2767 goto out; 2773 2768 2774 - if (!cifs_find_lock_conflict(cfile, iocb->ki_pos, iov_iter_count(from), 2769 + if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOPOSIXBRL) && 2770 + (cifs_find_lock_conflict(cfile, iocb->ki_pos, iov_iter_count(from), 2775 2771 server->vals->exclusive_lock_type, 0, 2776 - NULL, CIFS_WRITE_OP)) 2777 - rc = netfs_buffered_write_iter_locked(iocb, from, NULL); 2778 - else 2772 + NULL, CIFS_WRITE_OP))) { 2779 2773 rc = -EACCES; 2774 + goto out; 2775 + } 2776 + 2777 + rc = netfs_buffered_write_iter_locked(iocb, from, NULL); 2778 + 2780 2779 out: 2781 2780 up_read(&cinode->lock_sem); 2782 2781 netfs_end_io_write(inode);
+2
fs/smb/common/smb2pdu.h
··· 1216 1216 ); 1217 1217 __u8 Buffer[]; 1218 1218 } __packed; 1219 + static_assert(offsetof(struct create_context, Buffer) == sizeof(struct create_context_hdr), 1220 + "struct member likely outside of __struct_group()"); 1219 1221 1220 1222 struct smb2_create_req { 1221 1223 struct smb2_hdr hdr;