diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2013-01-07 11:10:12 +0100 |
---|---|---|
committer | Josef Bacik <josef@toxicpanda.com> | 2013-01-14 19:53:22 +0100 |
commit | f9e4fb53938de5db01950c9dfe479703b2f5c964 (patch) | |
tree | 95e9e8326d4a39feedc591c8d05de33d5db46d96 /fs/btrfs/file.c | |
parent | Btrfs: fix off-by-one in lseek (diff) | |
download | linux-f9e4fb53938de5db01950c9dfe479703b2f5c964.tar.xz linux-f9e4fb53938de5db01950c9dfe479703b2f5c964.zip |
Btrfs: fix a bug when llseek for delalloc bytes behind prealloc extents
xfstests case 285 complains.
It it because btrfs did not try to find unwritten delalloc
bytes(only dirty pages, not yet writeback) behind prealloc
extents, it ends up finding nothing while we're with SEEK_DATA.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index fa48051484b8..841cfe3be0e0 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -2309,9 +2309,12 @@ static int find_desired_extent(struct inode *inode, loff_t *offset, int origin) } } - *offset = start; - free_extent_map(em); - break; + if (!test_bit(EXTENT_FLAG_PREALLOC, + &em->flags)) { + *offset = start; + free_extent_map(em); + break; + } } } |