X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=fs%2Fioctl.c;h=7b17a14396ff792152ae6da49d178355d5a5e7ea;hb=36520be8e32b49bd85a63b7b8b40cd07c3da59a5;hp=5612880fcbe7d7436f3579c7c1add7360170e407;hpb=3e63cbb1efca7dd3137de1bb475e2e068e38ef23;p=safe%2Fjmp%2Flinux-2.6 diff --git a/fs/ioctl.c b/fs/ioctl.c index 5612880..7b17a14 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c @@ -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; }