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
53aa6bbf
Commit
53aa6bbf
authored
May 25, 2016
by
Jaegeuk Kim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
f2fs: inject to produce some orphan inodes
Signed-off-by:
Jaegeuk Kim
<
jaegeuk@kernel.org
>
parent
42d96401
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
0 deletions
+9
-0
fs/f2fs/f2fs.h
fs/f2fs/f2fs.h
+3
-0
fs/f2fs/inode.c
fs/f2fs/inode.c
+5
-0
fs/f2fs/super.c
fs/f2fs/super.c
+1
-0
No files found.
fs/f2fs/f2fs.h
View file @
53aa6bbf
...
@@ -45,6 +45,7 @@ enum {
...
@@ -45,6 +45,7 @@ enum {
FAULT_ORPHAN
,
FAULT_ORPHAN
,
FAULT_BLOCK
,
FAULT_BLOCK
,
FAULT_DIR_DEPTH
,
FAULT_DIR_DEPTH
,
FAULT_EVICT_INODE
,
FAULT_MAX
,
FAULT_MAX
,
};
};
...
@@ -74,6 +75,8 @@ static inline bool time_to_inject(int type)
...
@@ -74,6 +75,8 @@ static inline bool time_to_inject(int type)
return
false
;
return
false
;
else
if
(
type
==
FAULT_DIR_DEPTH
&&
!
IS_FAULT_SET
(
type
))
else
if
(
type
==
FAULT_DIR_DEPTH
&&
!
IS_FAULT_SET
(
type
))
return
false
;
return
false
;
else
if
(
type
==
FAULT_EVICT_INODE
&&
!
IS_FAULT_SET
(
type
))
return
false
;
atomic_inc
(
&
f2fs_fault
.
inject_ops
);
atomic_inc
(
&
f2fs_fault
.
inject_ops
);
if
(
atomic_read
(
&
f2fs_fault
.
inject_ops
)
>=
f2fs_fault
.
inject_rate
)
{
if
(
atomic_read
(
&
f2fs_fault
.
inject_ops
)
>=
f2fs_fault
.
inject_rate
)
{
...
...
fs/f2fs/inode.c
View file @
53aa6bbf
...
@@ -345,6 +345,11 @@ void f2fs_evict_inode(struct inode *inode)
...
@@ -345,6 +345,11 @@ void f2fs_evict_inode(struct inode *inode)
if
(
inode
->
i_nlink
||
is_bad_inode
(
inode
))
if
(
inode
->
i_nlink
||
is_bad_inode
(
inode
))
goto
no_delete
;
goto
no_delete
;
#ifdef CONFIG_F2FS_FAULT_INJECTION
if
(
time_to_inject
(
FAULT_EVICT_INODE
))
goto
no_delete
;
#endif
sb_start_intwrite
(
inode
->
i_sb
);
sb_start_intwrite
(
inode
->
i_sb
);
set_inode_flag
(
inode
,
FI_NO_ALLOC
);
set_inode_flag
(
inode
,
FI_NO_ALLOC
);
i_size_write
(
inode
,
0
);
i_size_write
(
inode
,
0
);
...
...
fs/f2fs/super.c
View file @
53aa6bbf
...
@@ -49,6 +49,7 @@ char *fault_name[FAULT_MAX] = {
...
@@ -49,6 +49,7 @@ char *fault_name[FAULT_MAX] = {
[
FAULT_ORPHAN
]
=
"orphan"
,
[
FAULT_ORPHAN
]
=
"orphan"
,
[
FAULT_BLOCK
]
=
"no more block"
,
[
FAULT_BLOCK
]
=
"no more block"
,
[
FAULT_DIR_DEPTH
]
=
"too big dir depth"
,
[
FAULT_DIR_DEPTH
]
=
"too big dir depth"
,
[
FAULT_EVICT_INODE
]
=
"evict_inode fail"
,
};
};
static
void
f2fs_build_fault_attr
(
unsigned
int
rate
)
static
void
f2fs_build_fault_attr
(
unsigned
int
rate
)
...
...
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