alist
alist copied to clipboard
[data race] smb驱动中存在潜在的data race
Please make sure of the following things
- [X] I have read the documentation.
- [X] I'm sure there are no duplicate issues or discussions.
- [X] I'm sure it's due to
alistand not something else(such asDependenciesorOperational). - [x] I'm sure I'm using the latest version
Alist Version / Alist 版本
latest
Driver used / 使用的存储驱动
smb
Describe the bug / 问题描述
smb驱动中多个方法调用和updateLastConnTime()来更新d.lastConnTime,同时也存在直接读取该变量的情况.
并发的读写该变量可能会产生不可预料的问题,建议改成int64类型并用原子操作进行读写
func (d *SMB) updateLastConnTime() {
d.lastConnTime = time.Now()
}
我愿意提交一个PR来修复此问题.
Reproduction / 复现链接
N/A
Logs / 日志
No response
Thanks for opening your first issue here! Be sure to follow the issue template!
@Xhofe 已提交PR