Commit
3ddce635 was over-aggressive and enabled direct-io in the loop
driver even if the underlying file system didn't support it. This
would cause a NULL dereference of aops->direct_IO.
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
/*
* UEK kernel will use direct-io whenever possible
*/
- __loop_update_dio(lo, 1);
+ struct address_space *mapping = lo->lo_backing_file->f_mapping;
+ bool supports_dio = mapping->a_ops->direct_IO != NULL;
+
+ __loop_update_dio(lo, supports_dio);
}
/*