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
nexedi
linux
Commits
c0ef65d2
Commit
c0ef65d2
authored
Jun 16, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ufs_iget(): fail with -ESTALE on deleted inode
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
23ac7cba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
fs/ufs/inode.c
fs/ufs/inode.c
+8
-13
No files found.
fs/ufs/inode.c
View file @
c0ef65d2
...
...
@@ -566,10 +566,8 @@ static int ufs1_read_inode(struct inode *inode, struct ufs_inode *ufs_inode)
*/
inode
->
i_mode
=
mode
=
fs16_to_cpu
(
sb
,
ufs_inode
->
ui_mode
);
set_nlink
(
inode
,
fs16_to_cpu
(
sb
,
ufs_inode
->
ui_nlink
));
if
(
inode
->
i_nlink
==
0
)
{
ufs_error
(
sb
,
"ufs_read_inode"
,
"inode %lu has zero nlink
\n
"
,
inode
->
i_ino
);
return
-
1
;
}
if
(
inode
->
i_nlink
==
0
)
return
-
ESTALE
;
/*
* Linux now has 32-bit uid and gid, so we can support EFT.
...
...
@@ -614,10 +612,8 @@ static int ufs2_read_inode(struct inode *inode, struct ufs2_inode *ufs2_inode)
*/
inode
->
i_mode
=
mode
=
fs16_to_cpu
(
sb
,
ufs2_inode
->
ui_mode
);
set_nlink
(
inode
,
fs16_to_cpu
(
sb
,
ufs2_inode
->
ui_nlink
));
if
(
inode
->
i_nlink
==
0
)
{
ufs_error
(
sb
,
"ufs_read_inode"
,
"inode %lu has zero nlink
\n
"
,
inode
->
i_ino
);
return
-
1
;
}
if
(
inode
->
i_nlink
==
0
)
return
-
ESTALE
;
/*
* Linux now has 32-bit uid and gid, so we can support EFT.
...
...
@@ -657,7 +653,7 @@ struct inode *ufs_iget(struct super_block *sb, unsigned long ino)
struct
ufs_sb_private_info
*
uspi
=
UFS_SB
(
sb
)
->
s_uspi
;
struct
buffer_head
*
bh
;
struct
inode
*
inode
;
int
err
;
int
err
=
-
EIO
;
UFSD
(
"ENTER, ino %lu
\n
"
,
ino
);
...
...
@@ -692,9 +688,10 @@ struct inode *ufs_iget(struct super_block *sb, unsigned long ino)
err
=
ufs1_read_inode
(
inode
,
ufs_inode
+
ufs_inotofsbo
(
inode
->
i_ino
));
}
brelse
(
bh
);
if
(
err
)
goto
bad_inode
;
inode
->
i_version
++
;
ufsi
->
i_lastfrag
=
(
inode
->
i_size
+
uspi
->
s_fsize
-
1
)
>>
uspi
->
s_fshift
;
...
...
@@ -703,15 +700,13 @@ struct inode *ufs_iget(struct super_block *sb, unsigned long ino)
ufs_set_inode_ops
(
inode
);
brelse
(
bh
);
UFSD
(
"EXIT
\n
"
);
unlock_new_inode
(
inode
);
return
inode
;
bad_inode:
iget_failed
(
inode
);
return
ERR_PTR
(
-
EIO
);
return
ERR_PTR
(
err
);
}
static
void
ufs1_update_inode
(
struct
inode
*
inode
,
struct
ufs_inode
*
ufs_inode
)
...
...
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