diff options
author | Jiaying Zhang <jiayingz@google.com> | 2010-02-24 15:52:53 +0100 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-02-24 15:52:53 +0100 |
commit | c8d46e41bc744c8fa0092112af3942fcd46c8b18 (patch) | |
tree | fd8bad55c3c9903b6c798b838396bc832bbf7f4b /fs/ext4/ioctl.c | |
parent | ext4: Fix BUG_ON at fs/buffer.c:652 in no journal mode (diff) | |
download | linux-c8d46e41bc744c8fa0092112af3942fcd46c8b18.tar.xz linux-c8d46e41bc744c8fa0092112af3942fcd46c8b18.zip |
ext4: Add flag to files with blocks intentionally past EOF
fallocate() may potentially instantiate blocks past EOF, depending
on the flags used when it is called.
e2fsck currently has a test for blocks past i_size, and it
sometimes trips up - noticeably on xfstests 013 which runs fsstress.
This patch from Jiayang does fix it up - it (along with
e2fsprogs updates and other patches recently from Aneesh) has
survived many fsstress runs in a row.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jiaying Zhang <jiayingz@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ioctl.c')
-rw-r--r-- | fs/ext4/ioctl.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index b63d193126db..2220feb2dcc1 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -92,6 +92,15 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) flags &= ~EXT4_EXTENTS_FL; } + if (flags & EXT4_EOFBLOCKS_FL) { + /* we don't support adding EOFBLOCKS flag */ + if (!(oldflags & EXT4_EOFBLOCKS_FL)) { + err = -EOPNOTSUPP; + goto flags_out; + } + } else if (oldflags & EXT4_EOFBLOCKS_FL) + ext4_truncate(inode); + handle = ext4_journal_start(inode, 1); if (IS_ERR(handle)) { err = PTR_ERR(handle); |