diff options
| author | Joseph Qi <joseph.qi@linux.alibaba.com> | 2026-11-10 17:48:29 +0800 |
|---|---|---|
| committer | Paulo Alcantara <pc@manguebit.org> | 2026-11-11 13:51:10 -0300 |
| commit | fce78321f1b59531cf6fc94860550db1db8dec55 (patch) | |
| tree | 9f0c4643708759827260e95cfb94262600c8ac66 /rust/kernel/alloc/kvec | |
| parent | f778a530f28546956e5f58db486fb74376f5d869 (diff) | |
smb: client: hold the inode across cifs_oplock_break()
cifs_oplock_break() drops the handle reference in the middle of the
handler and keeps using cinode afterwards, to send the break
acknowledgment and again in cifs_done_oplock_break(). The reference
cifs_queue_oplock_break() takes is the only pin: the handle holds the
dentry and the dentry is what keeps the inode alive.
When that put is the last reference, the dput() in
cifsFileInfo_put_final() kills an unhashed dentry, drops the last
i_count and evicts the inode, so the rest of the handler runs on an
object whose free is only RCU-deferred. An unhashed dentry that a
handle still references is an ordinary state: unlinking an open file
leaves the dentry that way, and so does the dcache teardown at unmount.
Take a reference on the inode for the lifetime of the handler and drop
it once the break has been reported. This also covers the
cifs_get_tlink() failure path, where the put is followed directly by
the out label.
Fixes: b98749cac4a6 ("CIFS: keep FileInfo handle live during oplock break")
Fixes: 23b26f4408ac ("smb: client: avoid leaking refcount when cifs_sb_tlink() fails")
Cc: stable@vger.kernel.org
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Diffstat (limited to 'rust/kernel/alloc/kvec')
0 files changed, 0 insertions, 0 deletions
