]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: prevent 32bit overflow in space reservation
authorDave Chinner <dchinner@redhat.com>
Fri, 3 Sep 2010 02:19:33 +0000 (12:19 +1000)
committerDave Chinner <david@fromorbit.com>
Fri, 3 Sep 2010 02:19:33 +0000 (12:19 +1000)
commiteb5f33c967e976ff96da44d8a8ffa1386137d09f
tree8841c80c9cf5873c915a821e98f3ae09746ec9d8
parentc07d272599a32f2721ed10c374a580fe5e0ff649
xfs: prevent 32bit overflow in space reservation

If we attempt to preallocate more than 2^32 blocks of space in a
single syscall, the transaction block reservation will overflow
leading to a hangs in the superblock block accounting code. This
is trivially reproduced with xfs_io. Fix the problem by capping the
allocation reservation to the maximum number of blocks a single
xfs_bmapi() call can allocate (2^21 blocks).

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_vnodeops.c