X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=fs%2Fioctl.c;h=7b17a14396ff792152ae6da49d178355d5a5e7ea;hb=25472b880c69c0daa485c4f80a6550437ed1149f;hp=5612880fcbe7d7436f3579c7c1add7360170e407;hpb=9b74aec028e7d7ce57b8deef490e440003555520;p=linux-2.6-microblaze.git diff --git a/fs/ioctl.c b/fs/ioctl.c index 5612880fcbe7..7b17a14396ff 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; }