Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
0ae0efad
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
0ae0efad
编写于
10月 10, 2005
作者:
S
Steve French
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CIFS] Fix rsize calculation so that large readx flag is checked.
Signed-off-by: Steve French (sfrench@us.ibm.com)
上级
68058e75
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
8 deletion
+28
-8
fs/cifs/cifs_debug.c
fs/cifs/cifs_debug.c
+1
-1
fs/cifs/connect.c
fs/cifs/connect.c
+24
-5
fs/cifs/file.c
fs/cifs/file.c
+3
-2
未找到文件。
fs/cifs/cifs_debug.c
浏览文件 @
0ae0efad
...
...
@@ -267,7 +267,7 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset,
atomic_read
(
&
tcon
->
num_oplock_brks
));
buf
+=
item_length
;
length
+=
item_length
;
item_length
=
sprintf
(
buf
,
"
\n
Reads: %d Bytes %lld"
,
item_length
=
sprintf
(
buf
,
"
\n
Reads: %d Bytes
:
%lld"
,
atomic_read
(
&
tcon
->
num_reads
),
(
long
long
)(
tcon
->
bytes_read
));
buf
+=
item_length
;
...
...
fs/cifs/connect.c
浏览文件 @
0ae0efad
...
...
@@ -30,6 +30,7 @@
#include <linux/mempool.h>
#include <linux/delay.h>
#include <linux/completion.h>
#include <linux/pagevec.h>
#include <asm/uaccess.h>
#include <asm/processor.h>
#include "cifspdu.h"
...
...
@@ -188,6 +189,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
server
->
server_RFC1001_name
);
}
if
(
rc
)
{
cERROR
(
1
,(
"reconnect error %d"
,
rc
));
msleep
(
3000
);
}
else
{
atomic_inc
(
&
tcpSesReconnectCount
);
...
...
@@ -469,6 +471,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
}
else
{
/* give server a second to
clean up before reconnect attempt */
cERROR
(
1
,(
"sleep before reconnect"
));
msleep
(
1000
);
/* always try 445 first on reconnect
since we get NACK on some if we ever
...
...
@@ -556,6 +559,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
dump_smb
(
smb_buffer
,
length
);
if
(
checkSMB
(
smb_buffer
,
smb_buffer
->
Mid
,
total_read
+
4
))
{
cERROR
(
1
,
(
"Bad SMB Received "
));
cifs_dump_mem
(
"smb: "
,
smb_buffer
,
48
);
continue
;
}
...
...
@@ -1383,7 +1387,9 @@ ipv4_connect(struct sockaddr_in *psin_server, struct socket **csocket,
the default. sock_setsockopt not used because it expects
user space buffer */
(
*
csocket
)
->
sk
->
sk_rcvtimeo
=
7
*
HZ
;
cERROR
(
1
,(
"sndbuf %d rcvbuf %d reset to 200K each"
,(
*
csocket
)
->
sk
->
sk_sndbuf
,
(
*
csocket
)
->
sk
->
sk_rcvbuf
));
(
*
csocket
)
->
sk
->
sk_sndbuf
=
300
*
1024
;
(
*
csocket
)
->
sk
->
sk_rcvbuf
=
200
*
1024
;
/* send RFC1001 sessinit */
if
(
psin_server
->
sin_port
==
htons
(
RFC1001_PORT
))
{
...
...
@@ -1736,11 +1742,20 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
/* search for existing tcon to this server share */
if
(
!
rc
)
{
if
((
volume_info
.
rsize
)
&&
(
volume_info
.
rsize
<=
CIFSMaxBufSize
))
if
(
volume_info
.
rsize
>
CIFSMaxBufSize
)
{
cERROR
(
1
,(
"rsize %d too large, using MaxBufSize"
,
volume_info
.
rsize
));
cifs_sb
->
rsize
=
CIFSMaxBufSize
;
}
else
if
((
volume_info
.
rsize
)
&&
(
volume_info
.
rsize
<=
CIFSMaxBufSize
))
cifs_sb
->
rsize
=
volume_info
.
rsize
;
else
cifs_sb
->
rsize
=
srvTcp
->
maxBuf
-
MAX_CIFS_HDR_SIZE
;
/* default */
if
(
volume_info
.
wsize
)
else
/* default */
cifs_sb
->
rsize
=
CIFSMaxBufSize
;
if
(
volume_info
.
wsize
>
PAGEVEC_SIZE
*
PAGE_CACHE_SIZE
)
{
cERROR
(
1
,(
"wsize %d too large using 4096 instead"
,
volume_info
.
wsize
));
cifs_sb
->
wsize
=
4096
;
}
else
if
(
volume_info
.
wsize
)
cifs_sb
->
wsize
=
volume_info
.
wsize
;
else
cifs_sb
->
wsize
=
CIFSMaxBufSize
;
/* default */
...
...
@@ -1895,6 +1910,10 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
cifs_sb
->
wsize
=
min
(
cifs_sb
->
wsize
,
(
tcon
->
ses
->
server
->
maxBuf
-
MAX_CIFS_HDR_SIZE
));
if
(
!
(
tcon
->
ses
->
capabilities
&
CAP_LARGE_READ_X
))
cifs_sb
->
rsize
=
min
(
cifs_sb
->
rsize
,
(
tcon
->
ses
->
server
->
maxBuf
-
MAX_CIFS_HDR_SIZE
));
}
/* volume_info.password is freed above when existing session found
...
...
fs/cifs/file.c
浏览文件 @
0ae0efad
...
...
@@ -855,7 +855,7 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
struct
kvec
iov
[
2
];
unsigned
int
len
;
len
=
min
(
cifs_sb
->
wsize
,
len
=
min
(
(
size_t
)
cifs_sb
->
wsize
,
write_size
-
total_written
);
/* iov[0] is reserved for smb header */
iov
[
1
].
iov_base
=
(
char
*
)
write_data
+
...
...
@@ -920,7 +920,8 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode)
((
open_file
->
pfile
->
f_flags
&
O_RDWR
)
||
(
open_file
->
pfile
->
f_flags
&
O_WRONLY
)))
{
read_unlock
(
&
GlobalSMBSeslock
);
if
(
open_file
->
invalidHandle
)
{
if
((
open_file
->
invalidHandle
)
&&
(
!
open_file
->
closePend
))
{
rc
=
cifs_reopen_file
(
&
cifs_inode
->
vfs_inode
,
open_file
->
pfile
,
FALSE
);
/* if it fails, try another handle - might be */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录