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
1301e421
Commit
1301e421
authored
Apr 01, 2021
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSv4: link must update the inode nlink.
Signed-off-by:
Trond Myklebust
<
trond.myklebust@hammerspace.com
>
parent
82eae5a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
fs/nfs/dir.c
fs/nfs/dir.c
+1
-1
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+9
-0
No files found.
fs/nfs/dir.c
View file @
1301e421
...
@@ -1711,7 +1711,7 @@ static void nfs_drop_nlink(struct inode *inode)
...
@@ -1711,7 +1711,7 @@ static void nfs_drop_nlink(struct inode *inode)
NFS_I
(
inode
)
->
attr_gencount
=
nfs_inc_attr_generation_counter
();
NFS_I
(
inode
)
->
attr_gencount
=
nfs_inc_attr_generation_counter
();
nfs_set_cache_invalid
(
nfs_set_cache_invalid
(
inode
,
NFS_INO_INVALID_CHANGE
|
NFS_INO_INVALID_CTIME
|
inode
,
NFS_INO_INVALID_CHANGE
|
NFS_INO_INVALID_CTIME
|
NFS_INO_INVALID_NLINK
|
NFS_INO_REVAL_FORCED
);
NFS_INO_INVALID_NLINK
);
spin_unlock
(
&
inode
->
i_lock
);
spin_unlock
(
&
inode
->
i_lock
);
}
}
...
...
fs/nfs/nfs4proc.c
View file @
1301e421
...
@@ -1175,6 +1175,14 @@ nfs4_inc_nlink_locked(struct inode *inode)
...
@@ -1175,6 +1175,14 @@ nfs4_inc_nlink_locked(struct inode *inode)
inc_nlink
(
inode
);
inc_nlink
(
inode
);
}
}
static
void
nfs4_inc_nlink
(
struct
inode
*
inode
)
{
spin_lock
(
&
inode
->
i_lock
);
nfs4_inc_nlink_locked
(
inode
);
spin_unlock
(
&
inode
->
i_lock
);
}
static
void
static
void
nfs4_dec_nlink_locked
(
struct
inode
*
inode
)
nfs4_dec_nlink_locked
(
struct
inode
*
inode
)
{
{
...
@@ -4791,6 +4799,7 @@ static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct
...
@@ -4791,6 +4799,7 @@ static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct
if
(
!
status
)
{
if
(
!
status
)
{
nfs4_update_changeattr
(
dir
,
&
res
.
cinfo
,
res
.
fattr
->
time_start
,
nfs4_update_changeattr
(
dir
,
&
res
.
cinfo
,
res
.
fattr
->
time_start
,
NFS_INO_INVALID_DATA
);
NFS_INO_INVALID_DATA
);
nfs4_inc_nlink
(
inode
);
status
=
nfs_post_op_update_inode
(
inode
,
res
.
fattr
);
status
=
nfs_post_op_update_inode
(
inode
,
res
.
fattr
);
if
(
!
status
)
if
(
!
status
)
nfs_setsecurity
(
inode
,
res
.
fattr
,
res
.
label
);
nfs_setsecurity
(
inode
,
res
.
fattr
,
res
.
label
);
...
...
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