Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions modules/cas_cache/classifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ static cas_cls_eval_t _cas_cls_metadata_test(struct cas_classifier *cls,
struct cas_cls_condition *c, struct cas_cls_io *io,
ocf_part_id_t part_id)
{
struct address_space *mapping;

if (!io->page)
return cas_cls_eval_no;

Expand All @@ -62,9 +64,10 @@ static cas_cls_eval_t _cas_cls_metadata_test(struct cas_classifier *cls,
return cas_cls_eval_yes;
}

if (!cas_page_mapping(io->page)) {
/* XFS case, page are allocated internally and do not
* have references into inode
mapping = cas_page_mapping(io->page);
if (!mapping || !virt_addr_valid(mapping)) {
/* XFS case: page is allocated internally without a page
* cache mapping.
*/
return cas_cls_eval_yes;
}
Expand Down Expand Up @@ -1284,6 +1287,9 @@ static void _cas_cls_get_bio_context(struct bio *bio,
if (!mapping)
return;

if (!virt_addr_valid(mapping))
return;

ctx->inode = mapping->host;

return;
Expand Down
Loading