Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359549
b: refs/heads/master
c: b7a1da6
h: refs/heads/master
i:
  359547: 2d9340c
v: v3
  • Loading branch information
Guo Chao authored and Jens Axboe committed Feb 22, 2013
1 parent 3e19420 commit 1dcdbab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b1a6650406875b9097a032eed89af50682fe1160
refs/heads/master: b7a1da695f3fb33d093e6de20b1dfc238e3c9587
9 changes: 5 additions & 4 deletions trunk/drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,13 @@ static struct loop_func_table *xfer_funcs[MAX_LO_CRYPT] = {

static loff_t get_size(loff_t offset, loff_t sizelimit, struct file *file)
{
loff_t size, loopsize;
loff_t loopsize;

/* Compute loopsize in bytes */
size = i_size_read(file->f_mapping->host);
loopsize = size - offset;
/* offset is beyond i_size, wierd but possible */
loopsize = i_size_read(file->f_mapping->host);
if (offset > 0)
loopsize -= offset;
/* offset is beyond i_size, weird but possible */
if (loopsize < 0)
return 0;

Expand Down

0 comments on commit 1dcdbab

Please sign in to comment.