]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ext4: Fix overflow caused by missing cast in ext4_fallocate()
authorUtako Kusaka <u-kusaka@wm.jp.nec.com>
Thu, 28 Jul 2011 02:11:20 +0000 (22:11 -0400)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Thu, 29 Nov 2012 06:50:57 +0000 (22:50 -0800)
commitf229693f043f91bf26b6c4cc1a5889404ee0acc5
tree1ef13209a3f85b654d4b3d75119ff916bf337720
parent95fc792d5b235c0dfd8f6328e5d4537f1a560477
ext4: Fix overflow caused by missing cast in ext4_fallocate()

Orabug: 15929836
The logical block number in map.l_blk is a __u32, and so before we
shift it left, by the block size, we neeed cast it to a 64-bit size.

Otherwise i_size can be corrupted on an ENOSPC.

Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/sda6     ext4     9843276    153056   9190200   2% /mnt/mp1
fallocate: /mnt/mp1/testfile: fallocate failed: No space left on device
  File: `/mnt/mp1/testfile'
  Size: 4293656576 Blocks: 19380440   IO Block: 4096   regular file
Device: 806h/2054d Inode: 12          Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2011-07-25 13:01:31.414490496 +0900
Modify: 2011-07-25 13:01:31.414490496 +0900
Change: 2011-07-25 13:01:31.454490495 +0900

Signed-off-by: Utako Kusaka <u-kusaka@wm.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
--
 fs/ext4/extents.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ext4/extents.c