Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
1b83d707
Commit
1b83d707
authored
Jun 11, 2008
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFS: Protect inode->i_nlink updates using inode->i_lock
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
d67d1c7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
fs/nfs/dir.c
fs/nfs/dir.c
+10
-2
No files found.
fs/nfs/dir.c
View file @
1b83d707
...
...
@@ -870,6 +870,14 @@ static int nfs_dentry_delete(struct dentry *dentry)
}
static
void
nfs_drop_nlink
(
struct
inode
*
inode
)
{
spin_lock
(
&
inode
->
i_lock
);
if
(
inode
->
i_nlink
>
0
)
drop_nlink
(
inode
);
spin_unlock
(
&
inode
->
i_lock
);
}
/*
* Called when the dentry loses inode.
* We use it to clean up silly-renamed files.
...
...
@@ -1420,7 +1428,7 @@ static int nfs_safe_remove(struct dentry *dentry)
error
=
NFS_PROTO
(
dir
)
->
remove
(
dir
,
&
dentry
->
d_name
);
/* The VFS may want to delete this inode */
if
(
error
==
0
)
drop_nlink
(
inode
);
nfs_
drop_nlink
(
inode
);
nfs_mark_for_revalidate
(
inode
);
}
else
error
=
NFS_PROTO
(
dir
)
->
remove
(
dir
,
&
dentry
->
d_name
);
...
...
@@ -1647,7 +1655,7 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
/* dentry still busy? */
goto
out
;
}
else
drop_nlink
(
new_inode
);
nfs_
drop_nlink
(
new_inode
);
go_ahead:
/*
...
...
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