Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etercifs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etercifs
Commits
991b250e
Commit
991b250e
authored
Feb 27, 2015
by
Pavel Shilovsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 3.19 sources from stable (v3.19)
parent
3f44b7fa
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
43 additions
and
39 deletions
+43
-39
cifs_debug.c
sources/3.19/cifs_debug.c
+4
-2
cifsglob.h
sources/3.19/cifsglob.h
+3
-3
file.c
sources/3.19/file.c
+5
-1
ioctl.c
sources/3.19/ioctl.c
+5
-16
netmisc.c
sources/3.19/netmisc.c
+7
-5
readdir.c
sources/3.19/readdir.c
+7
-3
smb2misc.c
sources/3.19/smb2misc.c
+7
-5
smb2ops.c
sources/3.19/smb2ops.c
+2
-1
smb2pdu.h
sources/3.19/smb2pdu.h
+1
-1
smb2transport.c
sources/3.19/smb2transport.c
+1
-1
smbencrypt.c
sources/3.19/smbencrypt.c
+1
-1
No files found.
sources/3.19/cifs_debug.c
View file @
991b250e
...
...
@@ -606,9 +606,11 @@ cifs_security_flags_handle_must_flags(unsigned int *flags)
*
flags
=
CIFSSEC_MUST_NTLMV2
;
else
if
((
*
flags
&
CIFSSEC_MUST_NTLM
)
==
CIFSSEC_MUST_NTLM
)
*
flags
=
CIFSSEC_MUST_NTLM
;
else
if
((
*
flags
&
CIFSSEC_MUST_LANMAN
)
==
CIFSSEC_MUST_LANMAN
)
else
if
(
CIFSSEC_MUST_LANMAN
&&
(
*
flags
&
CIFSSEC_MUST_LANMAN
)
==
CIFSSEC_MUST_LANMAN
)
*
flags
=
CIFSSEC_MUST_LANMAN
;
else
if
((
*
flags
&
CIFSSEC_MUST_PLNTXT
)
==
CIFSSEC_MUST_PLNTXT
)
else
if
(
CIFSSEC_MUST_PLNTXT
&&
(
*
flags
&
CIFSSEC_MUST_PLNTXT
)
==
CIFSSEC_MUST_PLNTXT
)
*
flags
=
CIFSSEC_MUST_PLNTXT
;
*
flags
|=
signflags
;
...
...
sources/3.19/cifsglob.h
View file @
991b250e
...
...
@@ -661,16 +661,16 @@ set_credits(struct TCP_Server_Info *server, const int val)
server
->
ops
->
set_credits
(
server
,
val
);
}
static
inline
__
u
64
static
inline
__
le
64
get_next_mid64
(
struct
TCP_Server_Info
*
server
)
{
return
server
->
ops
->
get_next_mid
(
server
);
return
cpu_to_le64
(
server
->
ops
->
get_next_mid
(
server
)
);
}
static
inline
__le16
get_next_mid
(
struct
TCP_Server_Info
*
server
)
{
__u16
mid
=
get_next_mid64
(
server
);
__u16
mid
=
server
->
ops
->
get_next_mid
(
server
);
/*
* The value in the SMB header should be little endian for easy
* on-the-wire decoding.
...
...
sources/3.19/file.c
View file @
991b250e
...
...
@@ -369,6 +369,7 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
struct
cifsLockInfo
*
li
,
*
tmp
;
struct
cifs_fid
fid
;
struct
cifs_pending_open
open
;
bool
oplock_break_cancelled
;
spin_lock
(
&
cifs_file_list_lock
);
if
(
--
cifs_file
->
count
>
0
)
{
...
...
@@ -400,7 +401,7 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
}
spin_unlock
(
&
cifs_file_list_lock
);
cancel_work_sync
(
&
cifs_file
->
oplock_break
);
oplock_break_cancelled
=
cancel_work_sync
(
&
cifs_file
->
oplock_break
);
if
(
!
tcon
->
need_reconnect
&&
!
cifs_file
->
invalidHandle
)
{
struct
TCP_Server_Info
*
server
=
tcon
->
ses
->
server
;
...
...
@@ -412,6 +413,9 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
_free_xid
(
xid
);
}
if
(
oplock_break_cancelled
)
cifs_done_oplock_break
(
cifsi
);
cifs_del_pending_open
(
&
open
);
/*
...
...
sources/3.19/ioctl.c
View file @
991b250e
...
...
@@ -86,21 +86,16 @@ static long cifs_ioctl_clone(unsigned int xid, struct file *dst_file,
}
src_inode
=
file_inode
(
src_file
.
file
);
rc
=
-
EINVAL
;
if
(
S_ISDIR
(
src_inode
->
i_mode
))
goto
out_fput
;
/*
* Note: cifs case is easier than btrfs since server responsible for
* checks for proper open modes and file type and if it wants
* server could even support copy of range where source = target
*/
/* so we do not deadlock racing two ioctls on same files */
if
(
target_inode
<
src_inode
)
{
mutex_lock_nested
(
&
target_inode
->
i_mutex
,
I_MUTEX_PARENT
);
mutex_lock_nested
(
&
src_inode
->
i_mutex
,
I_MUTEX_CHILD
);
}
else
{
mutex_lock_nested
(
&
src_inode
->
i_mutex
,
I_MUTEX_PARENT
);
mutex_lock_nested
(
&
target_inode
->
i_mutex
,
I_MUTEX_CHILD
);
}
lock_two_nondirectories
(
target_inode
,
src_inode
);
/* determine range to clone */
rc
=
-
EINVAL
;
...
...
@@ -124,13 +119,7 @@ static long cifs_ioctl_clone(unsigned int xid, struct file *dst_file,
out_unlock:
/* although unlocking in the reverse order from locking is not
strictly necessary here it is a little cleaner to be consistent */
if
(
target_inode
<
src_inode
)
{
mutex_unlock
(
&
src_inode
->
i_mutex
);
mutex_unlock
(
&
target_inode
->
i_mutex
);
}
else
{
mutex_unlock
(
&
target_inode
->
i_mutex
);
mutex_unlock
(
&
src_inode
->
i_mutex
);
}
unlock_two_nondirectories
(
src_inode
,
target_inode
);
out_fput:
fdput
(
src_file
);
out_drop_write:
...
...
sources/3.19/netmisc.c
View file @
991b250e
...
...
@@ -926,6 +926,7 @@ cifs_NTtimeToUnix(__le64 ntutc)
/* Subtract the NTFS time offset, then convert to 1s intervals. */
s64
t
=
le64_to_cpu
(
ntutc
)
-
NTFS_TIME_OFFSET
;
u64
abs_t
;
/*
* Unfortunately can not use normal 64 bit division on 32 bit arch, but
...
...
@@ -933,13 +934,14 @@ cifs_NTtimeToUnix(__le64 ntutc)
* to special case them
*/
if
(
t
<
0
)
{
t
=
-
t
;
ts
.
tv_nsec
=
(
long
)(
do_div
(
t
,
10000000
)
*
100
);
abs_
t
=
-
t
;
ts
.
tv_nsec
=
(
long
)(
do_div
(
abs_
t
,
10000000
)
*
100
);
ts
.
tv_nsec
=
-
ts
.
tv_nsec
;
ts
.
tv_sec
=
-
t
;
ts
.
tv_sec
=
-
abs_
t
;
}
else
{
ts
.
tv_nsec
=
(
long
)
do_div
(
t
,
10000000
)
*
100
;
ts
.
tv_sec
=
t
;
abs_t
=
t
;
ts
.
tv_nsec
=
(
long
)
do_div
(
abs_t
,
10000000
)
*
100
;
ts
.
tv_sec
=
abs_t
;
}
return
ts
;
...
...
sources/3.19/readdir.c
View file @
991b250e
...
...
@@ -69,7 +69,8 @@ static inline void dump_cifs_file_struct(struct file *file, char *label)
* Attempt to preload the dcache with the results from the FIND_FIRST/NEXT
*
* Find the dentry that matches "name". If there isn't one, create one. If it's
* a negative dentry or the uniqueid changed, then drop it and recreate it.
* a negative dentry or the uniqueid or filetype(mode) changed,
* then drop it and recreate it.
*/
static
void
cifs_prime_dcache
(
struct
dentry
*
parent
,
struct
qstr
*
name
,
...
...
@@ -97,8 +98,11 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
if
(
!
(
cifs_sb
->
mnt_cifs_flags
&
CIFS_MOUNT_SERVER_INUM
))
fattr
->
cf_uniqueid
=
CIFS_I
(
inode
)
->
uniqueid
;
/* update inode in place if i_ino didn't change */
if
(
CIFS_I
(
inode
)
->
uniqueid
==
fattr
->
cf_uniqueid
)
{
/* update inode in place
* if both i_ino and i_mode didn't change */
if
(
CIFS_I
(
inode
)
->
uniqueid
==
fattr
->
cf_uniqueid
&&
(
inode
->
i_mode
&
S_IFMT
)
==
(
fattr
->
cf_mode
&
S_IFMT
))
{
cifs_fattr_to_inode
(
inode
,
fattr
);
goto
out
;
}
...
...
sources/3.19/smb2misc.c
View file @
991b250e
...
...
@@ -32,12 +32,14 @@
static
int
check_smb2_hdr
(
struct
smb2_hdr
*
hdr
,
__u64
mid
)
{
__u64
wire_mid
=
le64_to_cpu
(
hdr
->
MessageId
);
/*
* Make sure that this really is an SMB, that it is a response,
* and that the message ids match.
*/
if
((
*
(
__le32
*
)
hdr
->
ProtocolId
==
SMB2_PROTO_NUMBER
)
&&
(
mid
==
hdr
->
MessageI
d
))
{
(
mid
==
wire_mi
d
))
{
if
(
hdr
->
Flags
&
SMB2_FLAGS_SERVER_TO_REDIR
)
return
0
;
else
{
...
...
@@ -51,11 +53,11 @@ check_smb2_hdr(struct smb2_hdr *hdr, __u64 mid)
if
(
*
(
__le32
*
)
hdr
->
ProtocolId
!=
SMB2_PROTO_NUMBER
)
cifs_dbg
(
VFS
,
"Bad protocol string signature header %x
\n
"
,
*
(
unsigned
int
*
)
hdr
->
ProtocolId
);
if
(
mid
!=
hdr
->
MessageI
d
)
if
(
mid
!=
wire_mi
d
)
cifs_dbg
(
VFS
,
"Mids do not match: %llu and %llu
\n
"
,
mid
,
hdr
->
MessageI
d
);
mid
,
wire_mi
d
);
}
cifs_dbg
(
VFS
,
"Bad SMB detected. The Mid=%llu
\n
"
,
hdr
->
MessageI
d
);
cifs_dbg
(
VFS
,
"Bad SMB detected. The Mid=%llu
\n
"
,
wire_mi
d
);
return
1
;
}
...
...
@@ -95,7 +97,7 @@ smb2_check_message(char *buf, unsigned int length)
{
struct
smb2_hdr
*
hdr
=
(
struct
smb2_hdr
*
)
buf
;
struct
smb2_pdu
*
pdu
=
(
struct
smb2_pdu
*
)
hdr
;
__u64
mid
=
hdr
->
MessageId
;
__u64
mid
=
le64_to_cpu
(
hdr
->
MessageId
)
;
__u32
len
=
get_rfc1002_length
(
buf
);
__u32
clc_len
;
/* calculated length */
int
command
;
...
...
sources/3.19/smb2ops.c
View file @
991b250e
...
...
@@ -176,10 +176,11 @@ smb2_find_mid(struct TCP_Server_Info *server, char *buf)
{
struct
mid_q_entry
*
mid
;
struct
smb2_hdr
*
hdr
=
(
struct
smb2_hdr
*
)
buf
;
__u64
wire_mid
=
le64_to_cpu
(
hdr
->
MessageId
);
spin_lock
(
&
GlobalMid_Lock
);
list_for_each_entry
(
mid
,
&
server
->
pending_mid_q
,
qhead
)
{
if
((
mid
->
mid
==
hdr
->
MessageI
d
)
&&
if
((
mid
->
mid
==
wire_mi
d
)
&&
(
mid
->
mid_state
==
MID_REQUEST_SUBMITTED
)
&&
(
mid
->
command
==
hdr
->
Command
))
{
spin_unlock
(
&
GlobalMid_Lock
);
...
...
sources/3.19/smb2pdu.h
View file @
991b250e
...
...
@@ -110,7 +110,7 @@ struct smb2_hdr {
__le16
CreditRequest
;
/* CreditResponse */
__le32
Flags
;
__le32
NextCommand
;
__
u64
MessageId
;
/* opaque - so can stay little endian */
__
le64
MessageId
;
__le32
ProcessId
;
__u32
TreeId
;
/* opaque - so do not make little endian */
__u64
SessionId
;
/* opaque - so do not make little endian */
...
...
sources/3.19/smb2transport.c
View file @
991b250e
...
...
@@ -490,7 +490,7 @@ smb2_mid_entry_alloc(const struct smb2_hdr *smb_buffer,
return
temp
;
else
{
memset
(
temp
,
0
,
sizeof
(
struct
mid_q_entry
));
temp
->
mid
=
smb_buffer
->
MessageId
;
/* always LE */
temp
->
mid
=
le64_to_cpu
(
smb_buffer
->
MessageId
);
temp
->
pid
=
current
->
pid
;
temp
->
command
=
smb_buffer
->
Command
;
/* Always LE */
temp
->
when_alloc
=
jiffies
;
...
...
sources/3.19/smbencrypt.c
View file @
991b250e
...
...
@@ -221,7 +221,7 @@ E_md4hash(const unsigned char *passwd, unsigned char *p16,
}
rc
=
mdfour
(
p16
,
(
unsigned
char
*
)
wpwd
,
len
*
sizeof
(
__le16
));
mem
set
(
wpwd
,
0
,
129
*
sizeof
(
__le16
));
mem
zero_explicit
(
wpwd
,
sizeof
(
wpwd
));
return
rc
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment