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 '6.4-rc2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull cifs client fixes from Steve French:
"Two smb3 client fixes, both related to deferred close, and also for
stable:

- send close for deferred handles before not after lease break
response to avoid possible sharing violations

- check all opens on an inode (looking for deferred handles) when
lease break is returned not just the handle the lease break came in
on"

* tag '6.4-rc2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
SMB3: drop reference to cfile before sending oplock break
SMB3: Close all deferred handles of inode in case of handle lease break

+22 -24
+2 -2
fs/cifs/cifsglob.h
··· 424 424 /* check for STATUS_NETWORK_SESSION_EXPIRED */ 425 425 bool (*is_session_expired)(char *); 426 426 /* send oplock break response */ 427 - int (*oplock_response)(struct cifs_tcon *, struct cifs_fid *, 428 - struct cifsInodeInfo *); 427 + int (*oplock_response)(struct cifs_tcon *tcon, __u64 persistent_fid, __u64 volatile_fid, 428 + __u16 net_fid, struct cifsInodeInfo *cifs_inode); 429 429 /* query remote filesystem */ 430 430 int (*queryfs)(const unsigned int, struct cifs_tcon *, 431 431 struct cifs_sb_info *, struct kstatfs *);
+13 -13
fs/cifs/file.c
··· 4881 4881 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 4882 4882 struct TCP_Server_Info *server = tcon->ses->server; 4883 4883 int rc = 0; 4884 - bool purge_cache = false; 4885 - struct cifs_deferred_close *dclose; 4886 - bool is_deferred = false; 4884 + bool purge_cache = false, oplock_break_cancelled; 4885 + __u64 persistent_fid, volatile_fid; 4886 + __u16 net_fid; 4887 4887 4888 4888 wait_on_bit(&cinode->flags, CIFS_INODE_PENDING_WRITERS, 4889 4889 TASK_UNINTERRUPTIBLE); ··· 4924 4924 * file handles but cached, then schedule deferred close immediately. 4925 4925 * So, new open will not use cached handle. 4926 4926 */ 4927 - spin_lock(&CIFS_I(inode)->deferred_lock); 4928 - is_deferred = cifs_is_deferred_close(cfile, &dclose); 4929 - spin_unlock(&CIFS_I(inode)->deferred_lock); 4930 4927 4931 - if (!CIFS_CACHE_HANDLE(cinode) && is_deferred && 4932 - cfile->deferred_close_scheduled && delayed_work_pending(&cfile->deferred)) { 4928 + if (!CIFS_CACHE_HANDLE(cinode) && !list_empty(&cinode->deferred_closes)) 4933 4929 cifs_close_deferred_file(cinode); 4934 - } 4935 4930 4931 + persistent_fid = cfile->fid.persistent_fid; 4932 + volatile_fid = cfile->fid.volatile_fid; 4933 + net_fid = cfile->fid.netfid; 4934 + oplock_break_cancelled = cfile->oplock_break_cancelled; 4935 + 4936 + _cifsFileInfo_put(cfile, false /* do not wait for ourself */, false); 4936 4937 /* 4937 4938 * releasing stale oplock after recent reconnect of smb session using 4938 4939 * a now incorrect file handle is not a data integrity issue but do 4939 4940 * not bother sending an oplock release if session to server still is 4940 4941 * disconnected since oplock already released by the server 4941 4942 */ 4942 - if (!cfile->oplock_break_cancelled) { 4943 - rc = tcon->ses->server->ops->oplock_response(tcon, &cfile->fid, 4944 - cinode); 4943 + if (!oplock_break_cancelled) { 4944 + rc = tcon->ses->server->ops->oplock_response(tcon, persistent_fid, 4945 + volatile_fid, net_fid, cinode); 4945 4946 cifs_dbg(FYI, "Oplock release rc = %d\n", rc); 4946 4947 } 4947 4948 4948 - _cifsFileInfo_put(cfile, false /* do not wait for ourself */, false); 4949 4949 cifs_done_oplock_break(cinode); 4950 4950 } 4951 4951
+4 -5
fs/cifs/smb1ops.c
··· 897 897 } 898 898 899 899 static int 900 - cifs_oplock_response(struct cifs_tcon *tcon, struct cifs_fid *fid, 901 - struct cifsInodeInfo *cinode) 900 + cifs_oplock_response(struct cifs_tcon *tcon, __u64 persistent_fid, 901 + __u64 volatile_fid, __u16 net_fid, struct cifsInodeInfo *cinode) 902 902 { 903 - return CIFSSMBLock(0, tcon, fid->netfid, current->tgid, 0, 0, 0, 0, 904 - LOCKING_ANDX_OPLOCK_RELEASE, false, 905 - CIFS_CACHE_READ(cinode) ? 1 : 0); 903 + return CIFSSMBLock(0, tcon, net_fid, current->tgid, 0, 0, 0, 0, 904 + LOCKING_ANDX_OPLOCK_RELEASE, false, CIFS_CACHE_READ(cinode) ? 1 : 0); 906 905 } 907 906 908 907 static int
+3 -4
fs/cifs/smb2ops.c
··· 2383 2383 } 2384 2384 2385 2385 static int 2386 - smb2_oplock_response(struct cifs_tcon *tcon, struct cifs_fid *fid, 2387 - struct cifsInodeInfo *cinode) 2386 + smb2_oplock_response(struct cifs_tcon *tcon, __u64 persistent_fid, 2387 + __u64 volatile_fid, __u16 net_fid, struct cifsInodeInfo *cinode) 2388 2388 { 2389 2389 if (tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_LEASING) 2390 2390 return SMB2_lease_break(0, tcon, cinode->lease_key, 2391 2391 smb2_get_lease_state(cinode)); 2392 2392 2393 - return SMB2_oplock_break(0, tcon, fid->persistent_fid, 2394 - fid->volatile_fid, 2393 + return SMB2_oplock_break(0, tcon, persistent_fid, volatile_fid, 2395 2394 CIFS_CACHE_READ(cinode) ? 1 : 0); 2396 2395 } 2397 2396