xfs: check for possible overflow in xfs_ioc_trim
authorTomas Racek <tracek@redhat.com>
Tue, 14 Aug 2012 08:35:04 +0000 (10:35 +0200)
committerBen Myers <bpm@sgi.com>
Thu, 16 Aug 2012 21:42:52 +0000 (16:42 -0500)
commit643bfc061c47e9c7661324a09fb0a0bc6601e5d6
tree7a4a47e6ccfe8b21efb99a438deb7369dff13ba3
parentc4982110ae93d7575503feb81d15e93c0c5f393c
xfs: check for possible overflow in xfs_ioc_trim

If range.start or range.minlen is bigger than filesystem size, return
invalid value error. This fixes possible overflow in BTOBB macro when
passed value was nearly ULLONG_MAX.

Signed-off-by: Tomas Racek <tracek@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_discard.c