]> git.openfabrics.org - ~shefty/rdma-dev.git/blobdiff - fs/btrfs/inode.c
Btrfs: fix use after free in O_DIRECT
[~shefty/rdma-dev.git] / fs / btrfs / inode.c
index 0f34cae0a6332692cc0887c142c2ae77cd758e3c..ae6c0d190bc1e75d275894c0a8dc5b22b6489f5e 100644 (file)
@@ -5934,8 +5934,7 @@ free_ordered:
         */
        if (write) {
                struct btrfs_ordered_extent *ordered;
-               ordered = btrfs_lookup_ordered_extent(inode,
-                                                     dip->logical_offset);
+               ordered = btrfs_lookup_ordered_extent(inode, file_offset);
                if (!test_bit(BTRFS_ORDERED_PREALLOC, &ordered->flags) &&
                    !test_bit(BTRFS_ORDERED_NOCOW, &ordered->flags))
                        btrfs_free_reserved_extent(root, ordered->start,