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, 23 Aug 2012 19:48:44 +0000 (14:48 -0500)
commita672e1be30d5bc848cd0067c55ed29b2015b7c17
treecabdd7348997ae1d7a478a5c699eb0a954a1ed7d
parent761290309939743ddf97e2bd94c6da18c6436b79
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