]> git.hungrycats.org Git - linux/commitdiff
[PATCH] loop_set_fd() sendfile check fix
authorAndrew Morton <akpm@osdl.org>
Wed, 21 Apr 2004 00:44:58 +0000 (17:44 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 21 Apr 2004 00:44:58 +0000 (17:44 -0700)
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.

drivers/block/loop.c

index f9c506d93c69403e7fe82018d57d6327843c723e..37afd96d70094250551855e7f41a3a07cc2ff161 100644 (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,
                 * it's going to be read-only.
                 */
-               if (!lo_file->f_op->sendfile)
+               if (!file->f_op->sendfile)
                        goto out_putf;
 
                if (!aops->prepare_write || !aops->commit_write)