mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-29 09:12:07 +00:00
smb: Initialize cfid->tcon before performing network ops
Avoid leaking a tcon ref when a lease break races with opening the
cached directory. Processing the leak break might take a reference to
the tcon in cached_dir_lease_break() and then fail to release the ref in
cached_dir_offload_close, since cfid->tcon is still NULL.
Fixes: ebe98f1447
("cifs: enable caching of directories for which a lease is held")
Signed-off-by: Paul Aurich <paul@darkrain42.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
3fa640d035
commit
c353ee4fb1
@ -229,6 +229,7 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
|
||||
}
|
||||
}
|
||||
cfid->dentry = dentry;
|
||||
cfid->tcon = tcon;
|
||||
|
||||
/*
|
||||
* We do not hold the lock for the open because in case
|
||||
@ -300,7 +301,6 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
|
||||
}
|
||||
goto oshr_free;
|
||||
}
|
||||
cfid->tcon = tcon;
|
||||
cfid->is_open = true;
|
||||
|
||||
spin_lock(&cfids->cfid_list_lock);
|
||||
|
Loading…
Reference in New Issue
Block a user