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
eb829ed5
Commit
eb829ed5
authored
Oct 14, 2009
by
Evgeny Sinelnikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed fd duplicate problem with locks for centos 5.2
parent
dcee4098
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
16 deletions
+22
-16
cifsfs.c
sources/centos52/cifsfs.c
+3
-2
cifsglob.h
sources/centos52/cifsglob.h
+1
-0
cifsproto.h
sources/centos52/cifsproto.h
+3
-3
cifssmb.c
sources/centos52/cifssmb.c
+4
-4
file.c
sources/centos52/file.c
+8
-6
misc.c
sources/centos52/misc.c
+1
-0
transport.c
sources/centos52/transport.c
+2
-1
No files found.
sources/centos52/cifsfs.c
View file @
eb829ed5
...
@@ -1005,6 +1005,7 @@ static int cifs_oplock_thread(void *dummyarg)
...
@@ -1005,6 +1005,7 @@ static int cifs_oplock_thread(void *dummyarg)
struct
cifsTconInfo
*
pTcon
;
struct
cifsTconInfo
*
pTcon
;
struct
inode
*
inode
;
struct
inode
*
inode
;
__u16
netfid
;
__u16
netfid
;
__u32
netpid
;
int
rc
;
int
rc
;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22)
...
@@ -1029,6 +1030,7 @@ static int cifs_oplock_thread(void *dummyarg)
...
@@ -1029,6 +1030,7 @@ static int cifs_oplock_thread(void *dummyarg)
pTcon
=
oplock_item
->
tcon
;
pTcon
=
oplock_item
->
tcon
;
inode
=
oplock_item
->
pinode
;
inode
=
oplock_item
->
pinode
;
netfid
=
oplock_item
->
netfid
;
netfid
=
oplock_item
->
netfid
;
netpid
=
oplock_item
->
netpid
;
spin_unlock
(
&
GlobalMid_Lock
);
spin_unlock
(
&
GlobalMid_Lock
);
DeleteOplockQEntry
(
oplock_item
);
DeleteOplockQEntry
(
oplock_item
);
/* can not grab inode sem here since it would
/* can not grab inode sem here since it would
...
@@ -1059,8 +1061,7 @@ static int cifs_oplock_thread(void *dummyarg)
...
@@ -1059,8 +1061,7 @@ static int cifs_oplock_thread(void *dummyarg)
to server still is disconnected since oplock
to server still is disconnected since oplock
already released by the server in that case */
already released by the server in that case */
if
(
pTcon
->
tidStatus
!=
CifsNeedReconnect
)
{
if
(
pTcon
->
tidStatus
!=
CifsNeedReconnect
)
{
rc
=
CIFSSMBLock
(
0
,
pTcon
,
netfid
,
netpid
,
rc
=
CIFSSMBLock
(
0
,
pTcon
,
netfid
,
0
/* len */
,
0
/* offset */
,
0
,
0
/* len */
,
0
/* offset */
,
0
,
0
,
LOCKING_ANDX_OPLOCK_RELEASE
,
0
,
LOCKING_ANDX_OPLOCK_RELEASE
,
0
/* wait flag */
);
0
/* wait flag */
);
...
...
sources/centos52/cifsglob.h
View file @
eb829ed5
...
@@ -458,6 +458,7 @@ struct oplock_q_entry {
...
@@ -458,6 +458,7 @@ struct oplock_q_entry {
struct
inode
*
pinode
;
struct
inode
*
pinode
;
struct
cifsTconInfo
*
tcon
;
struct
cifsTconInfo
*
tcon
;
__u16
netfid
;
__u16
netfid
;
__u32
netpid
;
};
};
/* for pending dnotify requests */
/* for pending dnotify requests */
...
...
sources/centos52/cifsproto.h
View file @
eb829ed5
...
@@ -89,7 +89,7 @@ extern int CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses,
...
@@ -89,7 +89,7 @@ extern int CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses,
const
int
stage
,
const
int
stage
,
const
struct
nls_table
*
nls_cp
);
const
struct
nls_table
*
nls_cp
);
extern
__u16
GetNextMid
(
struct
TCP_Server_Info
*
server
);
extern
__u16
GetNextMid
(
struct
TCP_Server_Info
*
server
);
extern
struct
oplock_q_entry
*
AllocOplockQEntry
(
struct
inode
*
,
u16
,
extern
struct
oplock_q_entry
*
AllocOplockQEntry
(
struct
inode
*
,
u16
,
__u32
,
struct
cifsTconInfo
*
);
struct
cifsTconInfo
*
);
extern
void
DeleteOplockQEntry
(
struct
oplock_q_entry
*
);
extern
void
DeleteOplockQEntry
(
struct
oplock_q_entry
*
);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
...
@@ -308,12 +308,12 @@ extern int cifsConvertToUCS(__le16 *target, const char *source, int maxlen,
...
@@ -308,12 +308,12 @@ extern int cifsConvertToUCS(__le16 *target, const char *source, int maxlen,
const
struct
nls_table
*
cp
,
int
mapChars
);
const
struct
nls_table
*
cp
,
int
mapChars
);
extern
int
CIFSSMBLock
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
extern
int
CIFSSMBLock
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
const
__u16
netfid
,
const
__u64
len
,
const
__u16
netfid
,
const
__u
32
netpid
,
const
__u
64
len
,
const
__u64
offset
,
const
__u32
numUnlock
,
const
__u64
offset
,
const
__u32
numUnlock
,
const
__u32
numLock
,
const
__u8
lockType
,
const
__u32
numLock
,
const
__u8
lockType
,
const
int
waitFlag
);
const
int
waitFlag
);
extern
int
CIFSSMBPosixLock
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
extern
int
CIFSSMBPosixLock
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
const
__u16
smb_file_id
,
const
int
get_flag
,
const
__u16
smb_file_id
,
const
__u32
netpid
,
const
int
get_flag
,
const
__u64
len
,
struct
file_lock
*
,
const
__u64
len
,
struct
file_lock
*
,
const
__u16
lock_type
,
const
int
waitFlag
);
const
__u16
lock_type
,
const
int
waitFlag
);
extern
int
CIFSSMBTDis
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
);
extern
int
CIFSSMBTDis
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
);
...
...
sources/centos52/cifssmb.c
View file @
eb829ed5
...
@@ -1697,7 +1697,7 @@ CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon,
...
@@ -1697,7 +1697,7 @@ CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon,
int
int
CIFSSMBLock
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
CIFSSMBLock
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
const
__u16
smb_file_id
,
const
__u64
len
,
const
__u16
smb_file_id
,
const
__u
32
net_pid
,
const
__u
64
len
,
const
__u64
offset
,
const
__u32
numUnlock
,
const
__u64
offset
,
const
__u32
numUnlock
,
const
__u32
numLock
,
const
__u8
lockType
,
const
int
waitFlag
)
const
__u32
numLock
,
const
__u8
lockType
,
const
int
waitFlag
)
{
{
...
@@ -1733,7 +1733,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
...
@@ -1733,7 +1733,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
pSMB
->
Fid
=
smb_file_id
;
/* netfid stays le */
pSMB
->
Fid
=
smb_file_id
;
/* netfid stays le */
if
((
numLock
!=
0
)
||
(
numUnlock
!=
0
))
{
if
((
numLock
!=
0
)
||
(
numUnlock
!=
0
))
{
pSMB
->
Locks
[
0
].
Pid
=
cpu_to_le16
(
current
->
tg
id
);
pSMB
->
Locks
[
0
].
Pid
=
cpu_to_le16
(
net_p
id
);
/* BB where to store pid high? */
/* BB where to store pid high? */
pSMB
->
Locks
[
0
].
LengthLow
=
cpu_to_le32
((
u32
)
len
);
pSMB
->
Locks
[
0
].
LengthLow
=
cpu_to_le32
((
u32
)
len
);
pSMB
->
Locks
[
0
].
LengthHigh
=
cpu_to_le32
((
u32
)(
len
>>
32
));
pSMB
->
Locks
[
0
].
LengthHigh
=
cpu_to_le32
((
u32
)(
len
>>
32
));
...
@@ -1767,7 +1767,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
...
@@ -1767,7 +1767,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
int
int
CIFSSMBPosixLock
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
CIFSSMBPosixLock
(
const
int
xid
,
struct
cifsTconInfo
*
tcon
,
const
__u16
smb_file_id
,
const
int
get_flag
,
const
__u64
len
,
const
__u16
smb_file_id
,
const
__u32
net_pid
,
const
int
get_flag
,
const
__u64
len
,
struct
file_lock
*
pLockData
,
const
__u16
lock_type
,
struct
file_lock
*
pLockData
,
const
__u16
lock_type
,
const
int
waitFlag
)
const
int
waitFlag
)
{
{
...
@@ -1825,7 +1825,7 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
...
@@ -1825,7 +1825,7 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
}
else
}
else
pSMB
->
Timeout
=
0
;
pSMB
->
Timeout
=
0
;
parm_data
->
pid
=
cpu_to_le32
(
current
->
tg
id
);
parm_data
->
pid
=
cpu_to_le32
(
net_p
id
);
parm_data
->
start
=
cpu_to_le64
(
pLockData
->
fl_start
);
parm_data
->
start
=
cpu_to_le64
(
pLockData
->
fl_start
);
parm_data
->
length
=
cpu_to_le64
(
len
);
/* normalize negative numbers */
parm_data
->
length
=
cpu_to_le64
(
len
);
/* normalize negative numbers */
...
...
sources/centos52/file.c
View file @
eb829ed5
...
@@ -751,6 +751,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
...
@@ -751,6 +751,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
int
wait_flag
=
FALSE
;
int
wait_flag
=
FALSE
;
struct
cifs_sb_info
*
cifs_sb
;
struct
cifs_sb_info
*
cifs_sb
;
struct
cifsTconInfo
*
pTcon
;
struct
cifsTconInfo
*
pTcon
;
__u32
netpid
;
__u16
netfid
;
__u16
netfid
;
__u8
lockType
=
LOCKING_ANDX_LARGE_FILES
;
__u8
lockType
=
LOCKING_ANDX_LARGE_FILES
;
int
posix_locking
=
0
;
int
posix_locking
=
0
;
...
@@ -814,6 +815,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
...
@@ -814,6 +815,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
FreeXid
(
xid
);
FreeXid
(
xid
);
return
-
EBADF
;
return
-
EBADF
;
}
}
netpid
=
((
struct
cifsFileInfo
*
)
file
->
private_data
)
->
pid
;
netfid
=
((
struct
cifsFileInfo
*
)
file
->
private_data
)
->
netfid
;
netfid
=
((
struct
cifsFileInfo
*
)
file
->
private_data
)
->
netfid
;
if
((
pTcon
->
ses
->
capabilities
&
CAP_UNIX
)
&&
if
((
pTcon
->
ses
->
capabilities
&
CAP_UNIX
)
&&
...
@@ -831,7 +833,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
...
@@ -831,7 +833,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
posix_lock_type
=
CIFS_RDLCK
;
posix_lock_type
=
CIFS_RDLCK
;
else
else
posix_lock_type
=
CIFS_WRLCK
;
posix_lock_type
=
CIFS_WRLCK
;
rc
=
CIFSSMBPosixLock
(
xid
,
pTcon
,
netfid
,
1
/* get */
,
rc
=
CIFSSMBPosixLock
(
xid
,
pTcon
,
netfid
,
netpid
,
1
/* get */
,
length
,
pfLock
,
length
,
pfLock
,
posix_lock_type
,
wait_flag
);
posix_lock_type
,
wait_flag
);
FreeXid
(
xid
);
FreeXid
(
xid
);
...
@@ -839,10 +841,10 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
...
@@ -839,10 +841,10 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
}
}
/* BB we could chain these into one lock request BB */
/* BB we could chain these into one lock request BB */
rc
=
CIFSSMBLock
(
xid
,
pTcon
,
netfid
,
length
,
pfLock
->
fl_start
,
rc
=
CIFSSMBLock
(
xid
,
pTcon
,
netfid
,
netpid
,
length
,
pfLock
->
fl_start
,
0
,
1
,
lockType
,
0
/* wait flag */
);
0
,
1
,
lockType
,
0
/* wait flag */
);
if
(
rc
==
0
)
{
if
(
rc
==
0
)
{
rc
=
CIFSSMBLock
(
xid
,
pTcon
,
netfid
,
length
,
rc
=
CIFSSMBLock
(
xid
,
pTcon
,
netfid
,
netpid
,
length
,
pfLock
->
fl_start
,
1
/* numUnlock */
,
pfLock
->
fl_start
,
1
/* numUnlock */
,
0
/* numLock */
,
lockType
,
0
/* numLock */
,
lockType
,
0
/* wait flag */
);
0
/* wait flag */
);
...
@@ -879,7 +881,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
...
@@ -879,7 +881,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
if
(
numUnlock
==
1
)
if
(
numUnlock
==
1
)
posix_lock_type
=
CIFS_UNLCK
;
posix_lock_type
=
CIFS_UNLCK
;
rc
=
CIFSSMBPosixLock
(
xid
,
pTcon
,
netfid
,
0
/* set */
,
rc
=
CIFSSMBPosixLock
(
xid
,
pTcon
,
netfid
,
netpid
,
0
/* set */
,
length
,
pfLock
,
length
,
pfLock
,
posix_lock_type
,
wait_flag
);
posix_lock_type
,
wait_flag
);
}
else
{
}
else
{
...
@@ -887,7 +889,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
...
@@ -887,7 +889,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
(
struct
cifsFileInfo
*
)
file
->
private_data
;
(
struct
cifsFileInfo
*
)
file
->
private_data
;
if
(
numLock
)
{
if
(
numLock
)
{
rc
=
CIFSSMBLock
(
xid
,
pTcon
,
netfid
,
length
,
rc
=
CIFSSMBLock
(
xid
,
pTcon
,
netfid
,
netpid
,
length
,
pfLock
->
fl_start
,
pfLock
->
fl_start
,
0
,
numLock
,
lockType
,
wait_flag
);
0
,
numLock
,
lockType
,
wait_flag
);
...
@@ -909,7 +911,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
...
@@ -909,7 +911,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
(
pfLock
->
fl_start
+
length
)
>=
(
pfLock
->
fl_start
+
length
)
>=
(
li
->
offset
+
li
->
length
))
{
(
li
->
offset
+
li
->
length
))
{
stored_rc
=
CIFSSMBLock
(
xid
,
pTcon
,
stored_rc
=
CIFSSMBLock
(
xid
,
pTcon
,
netfid
,
netfid
,
netpid
,
li
->
length
,
li
->
offset
,
li
->
length
,
li
->
offset
,
1
,
0
,
li
->
type
,
FALSE
);
1
,
0
,
li
->
type
,
FALSE
);
if
(
stored_rc
)
if
(
stored_rc
)
...
...
sources/centos52/misc.c
View file @
eb829ed5
...
@@ -606,6 +606,7 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
...
@@ -606,6 +606,7 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
pCifsInode
->
oplockPending
=
TRUE
;
pCifsInode
->
oplockPending
=
TRUE
;
AllocOplockQEntry
(
netfile
->
pInode
,
AllocOplockQEntry
(
netfile
->
pInode
,
netfile
->
netfid
,
netfile
->
netfid
,
netfile
->
pid
,
tcon
);
tcon
);
cFYI
(
1
,
cFYI
(
1
,
(
"about to wake up oplock thread"
));
(
"about to wake up oplock thread"
));
...
...
sources/centos52/transport.c
View file @
eb829ed5
...
@@ -126,7 +126,7 @@ DeleteMidQEntry(struct mid_q_entry *midEntry)
...
@@ -126,7 +126,7 @@ DeleteMidQEntry(struct mid_q_entry *midEntry)
}
}
struct
oplock_q_entry
*
struct
oplock_q_entry
*
AllocOplockQEntry
(
struct
inode
*
pinode
,
__u16
fid
,
struct
cifsTconInfo
*
tcon
)
AllocOplockQEntry
(
struct
inode
*
pinode
,
__u16
fid
,
__u32
pid
,
struct
cifsTconInfo
*
tcon
)
{
{
struct
oplock_q_entry
*
temp
;
struct
oplock_q_entry
*
temp
;
if
((
pinode
==
NULL
)
||
(
tcon
==
NULL
))
{
if
((
pinode
==
NULL
)
||
(
tcon
==
NULL
))
{
...
@@ -141,6 +141,7 @@ AllocOplockQEntry(struct inode *pinode, __u16 fid, struct cifsTconInfo *tcon)
...
@@ -141,6 +141,7 @@ AllocOplockQEntry(struct inode *pinode, __u16 fid, struct cifsTconInfo *tcon)
temp
->
pinode
=
pinode
;
temp
->
pinode
=
pinode
;
temp
->
tcon
=
tcon
;
temp
->
tcon
=
tcon
;
temp
->
netfid
=
fid
;
temp
->
netfid
=
fid
;
temp
->
netpid
=
pid
;
spin_lock
(
&
GlobalMid_Lock
);
spin_lock
(
&
GlobalMid_Lock
);
list_add_tail
(
&
temp
->
qhead
,
&
GlobalOplock_Q
);
list_add_tail
(
&
temp
->
qhead
,
&
GlobalOplock_Q
);
spin_unlock
(
&
GlobalMid_Lock
);
spin_unlock
(
&
GlobalMid_Lock
);
...
...
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