From: Lukas Czerner Date: Fri, 2 Mar 2012 12:09:05 +0000 (+0100) Subject: ext3: fix start and len arguments handling in ext3_trim_fs() X-Git-Tag: v3.4-rc1~77^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e703c206135acb458adb705ec44bcc5d2615b37d;p=pandora-kernel.git ext3: fix start and len arguments handling in ext3_trim_fs() The overflow might happen when passing blocknr into ext3_get_group_no_and_offset(), because it expects type ext3_fsblk_t which might be smaller than uint64_t. This will most likely happen when calling FITRIM with the default argument len = ULLONG_MAX. Fix this by using "end" variable instead of "start+len" as it is easier to get right and specifically check that the end is not beyond the end of the file system, so we are sure that the result of get_group_no_and_offset() will not overflow. Otherwise truncate it to the size of the file system. Signed-off-by: Lukas Czerner Cc: Jan Kara Signed-off-by: Jan Kara --- Reading git-diff-tree failed