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
b6898917
Commit
b6898917
authored
Jun 21, 2023
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Check for ERR_PTR() from filemap_lock_folio()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
1bb3c2a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
fs/bcachefs/fs-io.c
fs/bcachefs/fs-io.c
+5
-5
No files found.
fs/bcachefs/fs-io.c
View file @
b6898917
...
...
@@ -124,7 +124,7 @@ static int filemap_get_contig_folios_d(struct address_space *mapping,
break
;
f
=
__filemap_get_folio
(
mapping
,
pos
>>
PAGE_SHIFT
,
fgp_flags
,
gfp
);
if
(
!
f
)
if
(
IS_ERR_OR_NULL
(
f
)
)
break
;
BUG_ON
(
folios
->
nr
&&
folio_pos
(
f
)
!=
pos
);
...
...
@@ -1764,7 +1764,7 @@ int bch2_write_begin(struct file *file, struct address_space *mapping,
folio
=
__filemap_get_folio
(
mapping
,
pos
>>
PAGE_SHIFT
,
FGP_LOCK
|
FGP_WRITE
|
FGP_CREAT
|
FGP_STABLE
,
mapping_gfp_mask
(
mapping
));
if
(
!
folio
)
if
(
IS_ERR_OR_NULL
(
folio
)
)
goto
err_unlock
;
if
(
folio_test_uptodate
(
folio
))
...
...
@@ -2852,7 +2852,7 @@ static int __bch2_truncate_folio(struct bch_inode_info *inode,
u64
end_pos
;
folio
=
filemap_lock_folio
(
mapping
,
index
);
if
(
!
folio
)
{
if
(
IS_ERR_OR_NULL
(
folio
)
)
{
/*
* XXX: we're doing two index lookups when we end up reading the
* folio
...
...
@@ -2865,7 +2865,7 @@ static int __bch2_truncate_folio(struct bch_inode_info *inode,
folio
=
__filemap_get_folio
(
mapping
,
index
,
FGP_LOCK
|
FGP_CREAT
,
GFP_KERNEL
);
if
(
unlikely
(
!
folio
))
{
if
(
unlikely
(
IS_ERR_OR_NULL
(
folio
)
))
{
ret
=
-
ENOMEM
;
goto
out
;
}
...
...
@@ -3788,7 +3788,7 @@ static bool folio_hole_offset(struct address_space *mapping, loff_t *offset)
bool
ret
=
true
;
folio
=
filemap_lock_folio
(
mapping
,
*
offset
>>
PAGE_SHIFT
);
if
(
!
folio
)
if
(
IS_ERR_OR_NULL
(
folio
)
)
return
true
;
s
=
bch2_folio
(
folio
);
...
...
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