From 64c8510e3af4e06685f70ce4cf4551866b3028f3 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Fri, 18 Sep 2009 13:05:50 -0700 Subject: [PATCH] --- yaml --- r: 165867 b: refs/heads/master c: 5aa98b706e83da4cde4172c890d6e815915536a0 h: refs/heads/master i: 165865: 0cfcca880a17b9826399b36a3675ce4546d0be94 165863: 52a9e19969ca4651e79232a04e6fa4e05dfd971d v: v3 --- [refs] | 2 +- trunk/fs/ioctl.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 4669616e88b7..ef51422d1761 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 05cc0cee6948fc11985d11557fb130645a7f69a6 +refs/heads/master: 5aa98b706e83da4cde4172c890d6e815915536a0 diff --git a/trunk/fs/ioctl.c b/trunk/fs/ioctl.c index 5612880fcbe7..7b17a14396ff 100644 --- a/trunk/fs/ioctl.c +++ b/trunk/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; }