Skip to content

Commit

Permalink
ore: Don't crash on NULL bio in _clear_bio
Browse files Browse the repository at this point in the history
In the case of target returning OSD_ERR_PRI_CLEAR_PAGES when we
only sent for attributes don't crash on NULL bio.
This is an osd-target bug but don't crash regardless

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
  • Loading branch information
Boaz Harrosh committed Jan 23, 2014
1 parent aad560b commit 2deb76d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fs/exofs/ore.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,12 @@ int ore_check_io(struct ore_io_state *ios, ore_on_dev_error on_dev_error)
if (likely(!ret))
continue;

if (OSD_ERR_PRI_CLEAR_PAGES == osi.osd_err_pri) {
/* start read offset passed endof file */
if ((OSD_ERR_PRI_CLEAR_PAGES == osi.osd_err_pri) &&
per_dev->bio) {
/* start read offset passed endof file.
* Note: if we do not have bio it means read-attributes
* In this case we should return error to caller.
*/
_clear_bio(per_dev->bio);
ORE_DBGMSG("start read offset passed end of file "
"offset=0x%llx, length=0x%llx\n",
Expand Down

0 comments on commit 2deb76d

Please sign in to comment.