Commit cd546897 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] loop_set_fd() sendfile check fix

From: Yury Umanets <torque@ukrpost.net>

I have found small inconsistency in loop_set_fd().  It checks if
->sendfile() is implemented for passed block device file.  But in fact,
loop back device driver never calls it.  It uses ->sendfile() from backing
store file.
parent 57a3170c
...@@ -656,7 +656,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file, ...@@ -656,7 +656,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
* If we can't read - sorry. If we only can't write - well, * If we can't read - sorry. If we only can't write - well,
* it's going to be read-only. * it's going to be read-only.
*/ */
if (!lo_file->f_op->sendfile) if (!file->f_op->sendfile)
goto out_putf; goto out_putf;
if (!aops->prepare_write || !aops->commit_write) if (!aops->prepare_write || !aops->commit_write)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment