]> err.no Git - linux-2.6/blobdiff - drivers/block/loop.c
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[linux-2.6] / drivers / block / loop.c
index a5f993ac28ddce4e4bf670b06ebc8c321011bdc3..56e23042728ae093776a86a499da310511d51a91 100644 (file)
@@ -29,7 +29,7 @@
  *
  * Maximum number of loop devices when compiled-in now selectable by passing
  * max_loop=<1-255> to the kernel on boot.
- * Erik I. Bolsø, <eriki@himolde.no>, Oct 31, 1999
+ * Erik I. Bolsø, <eriki@himolde.no>, Oct 31, 1999
  *
  * Completely rewrite request handling to be make_request_fn style and
  * non blocking, pushing work to a helper thread. Lots of fixes from
@@ -245,10 +245,8 @@ static int do_lo_send_aops(struct loop_device *lo, struct bio_vec *bvec,
 
                ret = pagecache_write_end(file, mapping, pos, size, copied,
                                                        page, fsdata);
-               if (ret < 0)
+               if (ret < 0 || ret != copied)
                        goto fail;
-               if (ret < copied)
-                       copied = ret;
 
                if (unlikely(transfer_result))
                        goto fail;
@@ -1287,7 +1285,6 @@ static long lo_compat_ioctl(struct file *file, unsigned int cmd, unsigned long a
        struct loop_device *lo = inode->i_bdev->bd_disk->private_data;
        int err;
 
-       lock_kernel();
        switch(cmd) {
        case LOOP_SET_STATUS:
                mutex_lock(&lo->lo_ctl_mutex);
@@ -1313,7 +1310,6 @@ static long lo_compat_ioctl(struct file *file, unsigned int cmd, unsigned long a
                err = -ENOIOCTLCMD;
                break;
        }
-       unlock_kernel();
        return err;
 }
 #endif