diff options
Diffstat (limited to 'drivers/block/loop.c')
-rw-r--r-- | drivers/block/loop.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 9ca4bb014657..801f4ab83302 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
@@ -709,10 +709,6 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev, | |||
709 | if (!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode)) | 709 | if (!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode)) |
710 | goto out_putf; | 710 | goto out_putf; |
711 | 711 | ||
712 | /* new backing store needs to support loop (eg splice_read) */ | ||
713 | if (!inode->i_fop->splice_read) | ||
714 | goto out_putf; | ||
715 | |||
716 | /* size of the new backing store needs to be the same */ | 712 | /* size of the new backing store needs to be the same */ |
717 | if (get_loop_size(lo, file) != get_loop_size(lo, old_file)) | 713 | if (get_loop_size(lo, file) != get_loop_size(lo, old_file)) |
718 | goto out_putf; | 714 | goto out_putf; |
@@ -788,12 +784,7 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode, | |||
788 | error = -EINVAL; | 784 | error = -EINVAL; |
789 | if (S_ISREG(inode->i_mode) || S_ISBLK(inode->i_mode)) { | 785 | if (S_ISREG(inode->i_mode) || S_ISBLK(inode->i_mode)) { |
790 | const struct address_space_operations *aops = mapping->a_ops; | 786 | const struct address_space_operations *aops = mapping->a_ops; |
791 | /* | 787 | |
792 | * If we can't read - sorry. If we only can't write - well, | ||
793 | * it's going to be read-only. | ||
794 | */ | ||
795 | if (!file->f_op->splice_read) | ||
796 | goto out_putf; | ||
797 | if (aops->write_begin) | 788 | if (aops->write_begin) |
798 | lo_flags |= LO_FLAGS_USE_AOPS; | 789 | lo_flags |= LO_FLAGS_USE_AOPS; |
799 | if (!(lo_flags & LO_FLAGS_USE_AOPS) && !file->f_op->write) | 790 | if (!(lo_flags & LO_FLAGS_USE_AOPS) && !file->f_op->write) |