linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Fix long standing -EOPNOTSUPP problem caused by
@ 2018-03-01  2:47 Qu Wenruo
  2018-03-01  2:47 ` [PATCH 1/4] btrfs-progs: Limit inline extent below page size Qu Wenruo
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Qu Wenruo @ 2018-03-01  2:47 UTC (permalink / raw)
  To: linux-btrfs; +Cc: dsterba, peteryuchuang

Kernel doesn't support dropping range inside inline extent, and prevents
such thing happening by limiting max inline extent size to
min(max_inline, sectorsize - 1) in cow_file_range_inline().

However btrfs-progs only inherit the BTRFS_MAX_INLINE_DATA_SIZE() macro,
which doesn't have sectorsize check.
And since btrfs-progs defaults to 16K nodesize, above macro allows large
inline extent over 15K size.

This leads to unexpected kernel behavior.

The bug exists from the very beginning of btrfs-convert, dating back to
2008 when btrfs-convert is first introduced.

Qu Wenruo (4):
  btrfs-progs: Limit inline extent below page size
  btrfs-progs: check/original mode: Check inline extent size
  btrfs-progs: check/lowmem mode: Check inline extent size
  btrfs-progs: test/convert: Add test case for invalid large inline data
    extent

 check/main.c                                       |  4 ++++
 check/mode-lowmem.c                                |  8 ++++++++
 check/mode-original.h                              |  1 +
 ctree.h                                            | 11 +++++++++--
 .../016-invalid-large-inline-extent/test.sh        | 22 ++++++++++++++++++++++
 5 files changed, 44 insertions(+), 2 deletions(-)
 create mode 100755 tests/convert-tests/016-invalid-large-inline-extent/test.sh

-- 
2.16.2


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-03-09 16:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-01  2:47 [PATCH 0/4] Fix long standing -EOPNOTSUPP problem caused by Qu Wenruo
2018-03-01  2:47 ` [PATCH 1/4] btrfs-progs: Limit inline extent below page size Qu Wenruo
2018-03-01 17:47   ` Nikolay Borisov
2018-03-01 23:43     ` Qu Wenruo
2018-03-09 16:51   ` David Sterba
2018-03-01  2:47 ` [PATCH 2/4] btrfs-progs: check/original mode: Check inline extent size Qu Wenruo
2018-03-01  2:59   ` Su Yue
2018-03-01  2:47 ` [PATCH 3/4] btrfs-progs: check/lowmem " Qu Wenruo
2018-03-01  2:59   ` Su Yue
2018-03-01  2:47 ` [PATCH 4/4] btrfs-progs: test/convert: Add test case for invalid large inline data extent Qu Wenruo
2018-03-01 14:53 ` [PATCH 0/4] Fix long standing -EOPNOTSUPP problem caused by David Sterba
2018-03-02  5:25   ` Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).