Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165867
b: refs/heads/master
c: 5aa98b7
h: refs/heads/master
i:
  165865: 0cfcca8
  165863: 52a9e19
v: v3
  • Loading branch information
Jeff Layton authored and Al Viro committed Sep 24, 2009
1 parent b06bf42 commit 64c8510
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: 05cc0cee6948fc11985d11557fb130645a7f69a6
refs/heads/master: 5aa98b706e83da4cde4172c890d6e815915536a0
9 changes: 5 additions & 4 deletions trunk/fs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,21 @@ EXPORT_SYMBOL(fiemap_check_flags);
static int fiemap_check_ranges(struct super_block *sb,
u64 start, u64 len, u64 *new_len)
{
u64 maxbytes = (u64) sb->s_maxbytes;

*new_len = len;

if (len == 0)
return -EINVAL;

if (start > sb->s_maxbytes)
if (start > maxbytes)
return -EFBIG;

/*
* Shrink request scope to what the fs can actually handle.
*/
if ((len > sb->s_maxbytes) ||
(sb->s_maxbytes - len) < start)
*new_len = sb->s_maxbytes - start;
if (len > maxbytes || (maxbytes - len) < start)
*new_len = maxbytes - start;

return 0;
}
Expand Down

0 comments on commit 64c8510

Please sign in to comment.