Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
16da6fae
Commit
16da6fae
authored
May 27, 2004
by
Steve French
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://cifs.bkbits.net/linux-2.5cifs
into smfhome.smfdom:/home/stevef/linux-2.5cifs
parents
f2ccfa41
10b85801
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
2 deletions
+48
-2
fs/cifs/dir.c
fs/cifs/dir.c
+7
-0
fs/cifs/fcntl.c
fs/cifs/fcntl.c
+4
-0
fs/cifs/file.c
fs/cifs/file.c
+6
-1
fs/cifs/inode.c
fs/cifs/inode.c
+14
-0
fs/cifs/link.c
fs/cifs/link.c
+17
-1
No files found.
fs/cifs/dir.c
View file @
16da6fae
...
@@ -165,7 +165,9 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
...
@@ -165,7 +165,9 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
cifs_sb
=
CIFS_SB
(
inode
->
i_sb
);
cifs_sb
=
CIFS_SB
(
inode
->
i_sb
);
pTcon
=
cifs_sb
->
tcon
;
pTcon
=
cifs_sb
->
tcon
;
down
(
&
direntry
->
d_sb
->
s_vfs_rename_sem
);
full_path
=
build_path_from_dentry
(
direntry
);
full_path
=
build_path_from_dentry
(
direntry
);
up
(
&
direntry
->
d_sb
->
s_vfs_rename_sem
);
if
(
full_path
==
NULL
)
{
if
(
full_path
==
NULL
)
{
FreeXid
(
xid
);
FreeXid
(
xid
);
return
-
ENOMEM
;
return
-
ENOMEM
;
...
@@ -304,7 +306,9 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, dev_t dev
...
@@ -304,7 +306,9 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, dev_t dev
cifs_sb
=
CIFS_SB
(
inode
->
i_sb
);
cifs_sb
=
CIFS_SB
(
inode
->
i_sb
);
pTcon
=
cifs_sb
->
tcon
;
pTcon
=
cifs_sb
->
tcon
;
down
(
&
direntry
->
d_sb
->
s_vfs_rename_sem
);
full_path
=
build_path_from_dentry
(
direntry
);
full_path
=
build_path_from_dentry
(
direntry
);
up
(
&
direntry
->
d_sb
->
s_vfs_rename_sem
);
if
(
full_path
==
NULL
)
if
(
full_path
==
NULL
)
rc
=
-
ENOMEM
;
rc
=
-
ENOMEM
;
...
@@ -355,6 +359,9 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct name
...
@@ -355,6 +359,9 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct name
cifs_sb
=
CIFS_SB
(
parent_dir_inode
->
i_sb
);
cifs_sb
=
CIFS_SB
(
parent_dir_inode
->
i_sb
);
pTcon
=
cifs_sb
->
tcon
;
pTcon
=
cifs_sb
->
tcon
;
/* can not grab the rename sem here since it would
deadlock in the cases (beginning of sys_rename itself)
in which we already have the sb rename sem */
full_path
=
build_path_from_dentry
(
direntry
);
full_path
=
build_path_from_dentry
(
direntry
);
if
(
full_path
==
NULL
)
{
if
(
full_path
==
NULL
)
{
FreeXid
(
xid
);
FreeXid
(
xid
);
...
...
fs/cifs/fcntl.c
View file @
16da6fae
...
@@ -39,7 +39,11 @@ int cifs_directory_notify(unsigned long arg, struct file * file)
...
@@ -39,7 +39,11 @@ int cifs_directory_notify(unsigned long arg, struct file * file)
xid
=
GetXid
();
xid
=
GetXid
();
cifs_sb
=
CIFS_SB
(
file
->
f_dentry
->
d_sb
);
cifs_sb
=
CIFS_SB
(
file
->
f_dentry
->
d_sb
);
pTcon
=
cifs_sb
->
tcon
;
pTcon
=
cifs_sb
->
tcon
;
down
(
&
file
->
f_dentry
->
d_sb
->
s_vfs_rename_sem
);
full_path
=
build_path_from_dentry
(
file
->
f_dentry
);
full_path
=
build_path_from_dentry
(
file
->
f_dentry
);
up
(
&
file
->
f_dentry
->
d_sb
->
s_vfs_rename_sem
);
if
(
full_path
==
NULL
)
{
if
(
full_path
==
NULL
)
{
rc
=
-
ENOMEM
;
rc
=
-
ENOMEM
;
}
else
{
}
else
{
...
...
fs/cifs/file.c
View file @
16da6fae
...
@@ -80,7 +80,9 @@ cifs_open(struct inode *inode, struct file *file)
...
@@ -80,7 +80,9 @@ cifs_open(struct inode *inode, struct file *file)
}
}
}
}
down
(
&
inode
->
i_sb
->
s_vfs_rename_sem
);
full_path
=
build_path_from_dentry
(
file
->
f_dentry
);
full_path
=
build_path_from_dentry
(
file
->
f_dentry
);
up
(
&
inode
->
i_sb
->
s_vfs_rename_sem
);
if
(
full_path
==
NULL
)
{
if
(
full_path
==
NULL
)
{
FreeXid
(
xid
);
FreeXid
(
xid
);
return
-
ENOMEM
;
return
-
ENOMEM
;
...
@@ -291,7 +293,10 @@ static int cifs_reopen_file(struct inode *inode, struct file *file)
...
@@ -291,7 +293,10 @@ static int cifs_reopen_file(struct inode *inode, struct file *file)
}
}
cifs_sb
=
CIFS_SB
(
inode
->
i_sb
);
cifs_sb
=
CIFS_SB
(
inode
->
i_sb
);
pTcon
=
cifs_sb
->
tcon
;
pTcon
=
cifs_sb
->
tcon
;
/* can not grab rename sem here because various ops, including
those that already have the rename sem can end up causing writepage
to get called and if the server was down that means we end up here,
and we can never tell if the caller already has the rename_sem */
full_path
=
build_path_from_dentry
(
file
->
f_dentry
);
full_path
=
build_path_from_dentry
(
file
->
f_dentry
);
if
(
full_path
==
NULL
)
{
if
(
full_path
==
NULL
)
{
up
(
&
pCifsFile
->
fh_sem
);
up
(
&
pCifsFile
->
fh_sem
);
...
...
fs/cifs/inode.c
View file @
16da6fae
...
@@ -345,7 +345,11 @@ cifs_unlink(struct inode *inode, struct dentry *direntry)
...
@@ -345,7 +345,11 @@ cifs_unlink(struct inode *inode, struct dentry *direntry)
cifs_sb
=
CIFS_SB
(
inode
->
i_sb
);
cifs_sb
=
CIFS_SB
(
inode
->
i_sb
);
pTcon
=
cifs_sb
->
tcon
;
pTcon
=
cifs_sb
->
tcon
;
/* Unlink can be called from rename so we can not grab
the sem here since we deadlock otherwise */
/* down(&direntry->d_sb->s_vfs_rename_sem);*/
full_path
=
build_path_from_dentry
(
direntry
);
full_path
=
build_path_from_dentry
(
direntry
);
/* up(&direntry->d_sb->s_vfs_rename_sem);*/
if
(
full_path
==
NULL
)
{
if
(
full_path
==
NULL
)
{
FreeXid
(
xid
);
FreeXid
(
xid
);
return
-
ENOMEM
;
return
-
ENOMEM
;
...
@@ -430,7 +434,9 @@ cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
...
@@ -430,7 +434,9 @@ cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
cifs_sb
=
CIFS_SB
(
inode
->
i_sb
);
cifs_sb
=
CIFS_SB
(
inode
->
i_sb
);
pTcon
=
cifs_sb
->
tcon
;
pTcon
=
cifs_sb
->
tcon
;
down
(
&
inode
->
i_sb
->
s_vfs_rename_sem
);
full_path
=
build_path_from_dentry
(
direntry
);
full_path
=
build_path_from_dentry
(
direntry
);
up
(
&
inode
->
i_sb
->
s_vfs_rename_sem
);
if
(
full_path
==
NULL
)
{
if
(
full_path
==
NULL
)
{
FreeXid
(
xid
);
FreeXid
(
xid
);
return
-
ENOMEM
;
return
-
ENOMEM
;
...
@@ -487,7 +493,9 @@ cifs_rmdir(struct inode *inode, struct dentry *direntry)
...
@@ -487,7 +493,9 @@ cifs_rmdir(struct inode *inode, struct dentry *direntry)
cifs_sb
=
CIFS_SB
(
inode
->
i_sb
);
cifs_sb
=
CIFS_SB
(
inode
->
i_sb
);
pTcon
=
cifs_sb
->
tcon
;
pTcon
=
cifs_sb
->
tcon
;
down
(
&
inode
->
i_sb
->
s_vfs_rename_sem
);
full_path
=
build_path_from_dentry
(
direntry
);
full_path
=
build_path_from_dentry
(
direntry
);
up
(
&
inode
->
i_sb
->
s_vfs_rename_sem
);
if
(
full_path
==
NULL
)
{
if
(
full_path
==
NULL
)
{
FreeXid
(
xid
);
FreeXid
(
xid
);
return
-
ENOMEM
;
return
-
ENOMEM
;
...
@@ -536,6 +544,8 @@ cifs_rename(struct inode *source_inode, struct dentry *source_direntry,
...
@@ -536,6 +544,8 @@ cifs_rename(struct inode *source_inode, struct dentry *source_direntry,
different share. Might eventually add support for this */
different share. Might eventually add support for this */
}
}
/* we already have the rename sem so we do not need
to grab it again here to protect the path integrity */
fromName
=
build_path_from_dentry
(
source_direntry
);
fromName
=
build_path_from_dentry
(
source_direntry
);
toName
=
build_path_from_dentry
(
target_direntry
);
toName
=
build_path_from_dentry
(
target_direntry
);
if
((
fromName
==
NULL
)
||
(
toName
==
NULL
))
{
if
((
fromName
==
NULL
)
||
(
toName
==
NULL
))
{
...
@@ -603,6 +613,8 @@ cifs_revalidate(struct dentry *direntry)
...
@@ -603,6 +613,8 @@ cifs_revalidate(struct dentry *direntry)
cifs_sb
=
CIFS_SB
(
direntry
->
d_sb
);
cifs_sb
=
CIFS_SB
(
direntry
->
d_sb
);
/* can not safely grab the rename sem here if
rename calls revalidate since that would deadlock */
full_path
=
build_path_from_dentry
(
direntry
);
full_path
=
build_path_from_dentry
(
direntry
);
if
(
full_path
==
NULL
)
{
if
(
full_path
==
NULL
)
{
FreeXid
(
xid
);
FreeXid
(
xid
);
...
@@ -751,7 +763,9 @@ cifs_setattr(struct dentry *direntry, struct iattr *attrs)
...
@@ -751,7 +763,9 @@ cifs_setattr(struct dentry *direntry, struct iattr *attrs)
cifs_sb
=
CIFS_SB
(
direntry
->
d_inode
->
i_sb
);
cifs_sb
=
CIFS_SB
(
direntry
->
d_inode
->
i_sb
);
pTcon
=
cifs_sb
->
tcon
;
pTcon
=
cifs_sb
->
tcon
;
down
(
&
direntry
->
d_sb
->
s_vfs_rename_sem
);
full_path
=
build_path_from_dentry
(
direntry
);
full_path
=
build_path_from_dentry
(
direntry
);
up
(
&
direntry
->
d_sb
->
s_vfs_rename_sem
);
if
(
full_path
==
NULL
)
{
if
(
full_path
==
NULL
)
{
FreeXid
(
xid
);
FreeXid
(
xid
);
return
-
ENOMEM
;
return
-
ENOMEM
;
...
...
fs/cifs/link.c
View file @
16da6fae
...
@@ -44,10 +44,13 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
...
@@ -44,10 +44,13 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
cifs_sb_target
=
CIFS_SB
(
inode
->
i_sb
);
cifs_sb_target
=
CIFS_SB
(
inode
->
i_sb
);
pTcon
=
cifs_sb_target
->
tcon
;
pTcon
=
cifs_sb_target
->
tcon
;
/* No need to check for cross device links since server will do that - BB note DFS case in future though (when we may have to check) */
/* No need to check for cross device links since server will do that
BB note DFS case in future though (when we may have to check) */
down
(
&
inode
->
i_sb
->
s_vfs_rename_sem
);
fromName
=
build_path_from_dentry
(
old_file
);
fromName
=
build_path_from_dentry
(
old_file
);
toName
=
build_path_from_dentry
(
direntry
);
toName
=
build_path_from_dentry
(
direntry
);
up
(
&
inode
->
i_sb
->
s_vfs_rename_sem
);
if
((
fromName
==
NULL
)
||
(
toName
==
NULL
))
{
if
((
fromName
==
NULL
)
||
(
toName
==
NULL
))
{
rc
=
-
ENOMEM
;
rc
=
-
ENOMEM
;
goto
cifs_hl_exit
;
goto
cifs_hl_exit
;
...
@@ -96,7 +99,11 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
...
@@ -96,7 +99,11 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
struct
cifsTconInfo
*
pTcon
;
struct
cifsTconInfo
*
pTcon
;
xid
=
GetXid
();
xid
=
GetXid
();
down
(
&
direntry
->
d_sb
->
s_vfs_rename_sem
);
full_path
=
build_path_from_dentry
(
direntry
);
full_path
=
build_path_from_dentry
(
direntry
);
up
(
&
direntry
->
d_sb
->
s_vfs_rename_sem
);
if
(
full_path
==
NULL
)
{
if
(
full_path
==
NULL
)
{
FreeXid
(
xid
);
FreeXid
(
xid
);
return
-
ENOMEM
;
return
-
ENOMEM
;
...
@@ -159,7 +166,10 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
...
@@ -159,7 +166,10 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
cifs_sb
=
CIFS_SB
(
inode
->
i_sb
);
cifs_sb
=
CIFS_SB
(
inode
->
i_sb
);
pTcon
=
cifs_sb
->
tcon
;
pTcon
=
cifs_sb
->
tcon
;
down
(
&
inode
->
i_sb
->
s_vfs_rename_sem
);
full_path
=
build_path_from_dentry
(
direntry
);
full_path
=
build_path_from_dentry
(
direntry
);
up
(
&
inode
->
i_sb
->
s_vfs_rename_sem
);
if
(
full_path
==
NULL
)
{
if
(
full_path
==
NULL
)
{
FreeXid
(
xid
);
FreeXid
(
xid
);
return
-
ENOMEM
;
return
-
ENOMEM
;
...
@@ -219,7 +229,13 @@ cifs_readlink(struct dentry *direntry, char *pBuffer, int buflen)
...
@@ -219,7 +229,13 @@ cifs_readlink(struct dentry *direntry, char *pBuffer, int buflen)
xid
=
GetXid
();
xid
=
GetXid
();
cifs_sb
=
CIFS_SB
(
inode
->
i_sb
);
cifs_sb
=
CIFS_SB
(
inode
->
i_sb
);
pTcon
=
cifs_sb
->
tcon
;
pTcon
=
cifs_sb
->
tcon
;
/* BB would it be safe against deadlock to grab this sem
even though rename itself grabs the sem and calls lookup? */
/* down(&inode->i_sb->s_vfs_rename_sem);*/
full_path
=
build_path_from_dentry
(
direntry
);
full_path
=
build_path_from_dentry
(
direntry
);
/* up(&inode->i_sb->s_vfs_rename_sem);*/
if
(
full_path
==
NULL
)
{
if
(
full_path
==
NULL
)
{
FreeXid
(
xid
);
FreeXid
(
xid
);
return
-
ENOMEM
;
return
-
ENOMEM
;
...
...
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