diff options
| -rw-r--r-- | fs/btrfs/ioctl.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 7b001abc73c7..e1b47ef380d6 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
| @@ -3142,6 +3142,8 @@ process_slot: | |||
| 3142 | } else if (type == BTRFS_FILE_EXTENT_INLINE) { | 3142 | } else if (type == BTRFS_FILE_EXTENT_INLINE) { |
| 3143 | u64 skip = 0; | 3143 | u64 skip = 0; |
| 3144 | u64 trim = 0; | 3144 | u64 trim = 0; |
| 3145 | u64 aligned_end = 0; | ||
| 3146 | |||
| 3145 | if (off > key.offset) { | 3147 | if (off > key.offset) { |
| 3146 | skip = off - key.offset; | 3148 | skip = off - key.offset; |
| 3147 | new_key.offset += skip; | 3149 | new_key.offset += skip; |
| @@ -3158,9 +3160,11 @@ process_slot: | |||
| 3158 | size -= skip + trim; | 3160 | size -= skip + trim; |
| 3159 | datal -= skip + trim; | 3161 | datal -= skip + trim; |
| 3160 | 3162 | ||
| 3163 | aligned_end = ALIGN(new_key.offset + datal, | ||
| 3164 | root->sectorsize); | ||
| 3161 | ret = btrfs_drop_extents(trans, root, inode, | 3165 | ret = btrfs_drop_extents(trans, root, inode, |
| 3162 | new_key.offset, | 3166 | new_key.offset, |
| 3163 | new_key.offset + datal, | 3167 | aligned_end, |
| 3164 | 1); | 3168 | 1); |
| 3165 | if (ret) { | 3169 | if (ret) { |
| 3166 | if (ret != -EOPNOTSUPP) | 3170 | if (ret != -EOPNOTSUPP) |
