Commit 2d7b8c6b authored by Linus Torvalds's avatar Linus Torvalds

Merge tag '6.5-rc6-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client fixes from Steve French:
 "Three smb client fixes, all for stable:

   - fix for oops in unmount race with lease break of deferred close

   - debugging improvement for reconnect

   - fix for fscache deadlock (folio_wait_bit_common hang)"

* tag '6.5-rc6-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
  smb3: display network namespace in debug information
  cifs: Release folio lock on fscache read hit.
  cifs: fix potential oops in cifs_oplock_break
parents d4f8e13b 7b38f6dd
...@@ -153,6 +153,11 @@ cifs_dump_channel(struct seq_file *m, int i, struct cifs_chan *chan) ...@@ -153,6 +153,11 @@ cifs_dump_channel(struct seq_file *m, int i, struct cifs_chan *chan)
in_flight(server), in_flight(server),
atomic_read(&server->in_send), atomic_read(&server->in_send),
atomic_read(&server->num_waiters)); atomic_read(&server->num_waiters));
#ifdef CONFIG_NET_NS
if (server->net)
seq_printf(m, " Net namespace: %u ", server->net->ns.inum);
#endif /* NET_NS */
} }
static inline const char *smb_speed_to_str(size_t bps) static inline const char *smb_speed_to_str(size_t bps)
...@@ -430,10 +435,15 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v) ...@@ -430,10 +435,15 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
server->reconnect_instance, server->reconnect_instance,
server->srv_count, server->srv_count,
server->sec_mode, in_flight(server)); server->sec_mode, in_flight(server));
#ifdef CONFIG_NET_NS
if (server->net)
seq_printf(m, " Net namespace: %u ", server->net->ns.inum);
#endif /* NET_NS */
seq_printf(m, "\nIn Send: %d In MaxReq Wait: %d", seq_printf(m, "\nIn Send: %d In MaxReq Wait: %d",
atomic_read(&server->in_send), atomic_read(&server->in_send),
atomic_read(&server->num_waiters)); atomic_read(&server->num_waiters));
if (server->leaf_fullpath) { if (server->leaf_fullpath) {
seq_printf(m, "\nDFS leaf full path: %s", seq_printf(m, "\nDFS leaf full path: %s",
server->leaf_fullpath); server->leaf_fullpath);
......
...@@ -4681,9 +4681,9 @@ static int cifs_readpage_worker(struct file *file, struct page *page, ...@@ -4681,9 +4681,9 @@ static int cifs_readpage_worker(struct file *file, struct page *page,
io_error: io_error:
kunmap(page); kunmap(page);
unlock_page(page);
read_complete: read_complete:
unlock_page(page);
return rc; return rc;
} }
...@@ -4878,9 +4878,11 @@ void cifs_oplock_break(struct work_struct *work) ...@@ -4878,9 +4878,11 @@ void cifs_oplock_break(struct work_struct *work)
struct cifsFileInfo *cfile = container_of(work, struct cifsFileInfo, struct cifsFileInfo *cfile = container_of(work, struct cifsFileInfo,
oplock_break); oplock_break);
struct inode *inode = d_inode(cfile->dentry); struct inode *inode = d_inode(cfile->dentry);
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
struct cifsInodeInfo *cinode = CIFS_I(inode); struct cifsInodeInfo *cinode = CIFS_I(inode);
struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); struct cifs_tcon *tcon;
struct TCP_Server_Info *server = tcon->ses->server; struct TCP_Server_Info *server;
struct tcon_link *tlink;
int rc = 0; int rc = 0;
bool purge_cache = false, oplock_break_cancelled; bool purge_cache = false, oplock_break_cancelled;
__u64 persistent_fid, volatile_fid; __u64 persistent_fid, volatile_fid;
...@@ -4889,6 +4891,12 @@ void cifs_oplock_break(struct work_struct *work) ...@@ -4889,6 +4891,12 @@ void cifs_oplock_break(struct work_struct *work)
wait_on_bit(&cinode->flags, CIFS_INODE_PENDING_WRITERS, wait_on_bit(&cinode->flags, CIFS_INODE_PENDING_WRITERS,
TASK_UNINTERRUPTIBLE); TASK_UNINTERRUPTIBLE);
tlink = cifs_sb_tlink(cifs_sb);
if (IS_ERR(tlink))
goto out;
tcon = tlink_tcon(tlink);
server = tcon->ses->server;
server->ops->downgrade_oplock(server, cinode, cfile->oplock_level, server->ops->downgrade_oplock(server, cinode, cfile->oplock_level,
cfile->oplock_epoch, &purge_cache); cfile->oplock_epoch, &purge_cache);
...@@ -4938,18 +4946,19 @@ void cifs_oplock_break(struct work_struct *work) ...@@ -4938,18 +4946,19 @@ void cifs_oplock_break(struct work_struct *work)
/* /*
* MS-SMB2 3.2.5.19.1 and 3.2.5.19.2 (and MS-CIFS 3.2.5.42) do not require * MS-SMB2 3.2.5.19.1 and 3.2.5.19.2 (and MS-CIFS 3.2.5.42) do not require
* an acknowledgment to be sent when the file has already been closed. * an acknowledgment to be sent when the file has already been closed.
* check for server null, since can race with kill_sb calling tree disconnect.
*/ */
spin_lock(&cinode->open_file_lock); spin_lock(&cinode->open_file_lock);
if (tcon->ses && tcon->ses->server && !oplock_break_cancelled && /* check list empty since can race with kill_sb calling tree disconnect */
!list_empty(&cinode->openFileList)) { if (!oplock_break_cancelled && !list_empty(&cinode->openFileList)) {
spin_unlock(&cinode->open_file_lock); spin_unlock(&cinode->open_file_lock);
rc = tcon->ses->server->ops->oplock_response(tcon, persistent_fid, rc = server->ops->oplock_response(tcon, persistent_fid,
volatile_fid, net_fid, cinode); volatile_fid, net_fid, cinode);
cifs_dbg(FYI, "Oplock release rc = %d\n", rc); cifs_dbg(FYI, "Oplock release rc = %d\n", rc);
} else } else
spin_unlock(&cinode->open_file_lock); spin_unlock(&cinode->open_file_lock);
cifs_put_tlink(tlink);
out:
cifs_done_oplock_break(cinode); cifs_done_oplock_break(cinode);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment