diff options
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r-- | fs/ext4/extents.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index e910720e8bb..c4068f6abf0 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -2845,14 +2845,14 @@ fix_extent_len: | |||
2845 | * to an uninitialized extent. | 2845 | * to an uninitialized extent. |
2846 | * | 2846 | * |
2847 | * Writing to an uninitized extent may result in splitting the uninitialized | 2847 | * Writing to an uninitized extent may result in splitting the uninitialized |
2848 | * extent into multiple /intialized unintialized extents (up to three) | 2848 | * extent into multiple /initialized uninitialized extents (up to three) |
2849 | * There are three possibilities: | 2849 | * There are three possibilities: |
2850 | * a> There is no split required: Entire extent should be uninitialized | 2850 | * a> There is no split required: Entire extent should be uninitialized |
2851 | * b> Splits in two extents: Write is happening at either end of the extent | 2851 | * b> Splits in two extents: Write is happening at either end of the extent |
2852 | * c> Splits in three extents: Somone is writing in middle of the extent | 2852 | * c> Splits in three extents: Somone is writing in middle of the extent |
2853 | * | 2853 | * |
2854 | * One of more index blocks maybe needed if the extent tree grow after | 2854 | * One of more index blocks maybe needed if the extent tree grow after |
2855 | * the unintialized extent split. To prevent ENOSPC occur at the IO | 2855 | * the uninitialized extent split. To prevent ENOSPC occur at the IO |
2856 | * complete, we need to split the uninitialized extent before DIO submit | 2856 | * complete, we need to split the uninitialized extent before DIO submit |
2857 | * the IO. The uninitialized extent called at this time will be split | 2857 | * the IO. The uninitialized extent called at this time will be split |
2858 | * into three uninitialized extent(at most). After IO complete, the part | 2858 | * into three uninitialized extent(at most). After IO complete, the part |
@@ -3644,6 +3644,10 @@ long ext4_fallocate(struct inode *inode, int mode, loff_t offset, loff_t len) | |||
3644 | struct ext4_map_blocks map; | 3644 | struct ext4_map_blocks map; |
3645 | unsigned int credits, blkbits = inode->i_blkbits; | 3645 | unsigned int credits, blkbits = inode->i_blkbits; |
3646 | 3646 | ||
3647 | /* We only support the FALLOC_FL_KEEP_SIZE mode */ | ||
3648 | if (mode && (mode != FALLOC_FL_KEEP_SIZE)) | ||
3649 | return -EOPNOTSUPP; | ||
3650 | |||
3647 | /* | 3651 | /* |
3648 | * currently supporting (pre)allocate mode for extent-based | 3652 | * currently supporting (pre)allocate mode for extent-based |
3649 | * files _only_ | 3653 | * files _only_ |