mbox series

[00/11] Inode type conversion

Message ID cover.1719246104.git.dsterba@suse.com (mailing list archive)
Headers show
Series Inode type conversion | expand

Message

David Sterba June 24, 2024, 4:22 p.m. UTC
A small batch converting inode to btrfs_inode for internal functions and
data structures.

David Sterba (11):
  btrfs: pass a btrfs_inode to btrfs_readdir_put_delayed_items()
  btrfs: pass a btrfs_inode to btrfs_readdir_get_delayed_items()
  btrfs: pass a btrfs_inode to is_data_inode()
  btrfs: switch btrfs_block_group::inode to struct btrfs_inode
  btrfs: pass a btrfs_inode to btrfs_ioctl_send()
  btrfs: switch btrfs_pending_snapshot::dir to btrfs_inode
  btrfs: switch btrfs_ordered_extent::inode to struct btrfs_inode
  btrfs: pass a btrfs_inode to btrfs_compress_heuristic()
  btrfs: pass a btrfs_inode to btrfs_set_prop()
  btrfs: pass a btrfs_inode to btrfs_load_inode_props()
  btrfs: pass a btrfs_inode to btrfs_inode_inherit_props()

 fs/btrfs/bio.c              |  2 +-
 fs/btrfs/block-group.c      |  4 ++--
 fs/btrfs/block-group.h      |  2 +-
 fs/btrfs/btrfs_inode.h      |  4 ++--
 fs/btrfs/compression.c      |  6 +++---
 fs/btrfs/compression.h      |  2 +-
 fs/btrfs/delayed-inode.c    | 12 +++++------
 fs/btrfs/delayed-inode.h    |  4 ++--
 fs/btrfs/extent_io.c        |  2 +-
 fs/btrfs/free-space-cache.c |  4 ++--
 fs/btrfs/inode.c            | 18 ++++++++--------
 fs/btrfs/ioctl.c            | 16 +++++++-------
 fs/btrfs/ordered-data.c     | 22 +++++++++----------
 fs/btrfs/ordered-data.h     |  2 +-
 fs/btrfs/props.c            | 43 ++++++++++++++++++-------------------
 fs/btrfs/props.h            |  8 +++----
 fs/btrfs/relocation.c       |  2 +-
 fs/btrfs/send.c             |  4 ++--
 fs/btrfs/send.h             |  4 ++--
 fs/btrfs/subpage.c          |  4 ++--
 fs/btrfs/transaction.c      |  2 +-
 fs/btrfs/transaction.h      |  2 +-
 fs/btrfs/xattr.c            |  2 +-
 fs/btrfs/zoned.c            |  8 +++----
 24 files changed, 89 insertions(+), 90 deletions(-)

Comments

Boris Burkov June 24, 2024, 6:41 p.m. UTC | #1
On Mon, Jun 24, 2024 at 06:22:56PM +0200, David Sterba wrote:
> A small batch converting inode to btrfs_inode for internal functions and
> data structures.

Reviewed-by: Boris Burkov <boris@bur.io>

> 
> David Sterba (11):
>   btrfs: pass a btrfs_inode to btrfs_readdir_put_delayed_items()
>   btrfs: pass a btrfs_inode to btrfs_readdir_get_delayed_items()
>   btrfs: pass a btrfs_inode to is_data_inode()
>   btrfs: switch btrfs_block_group::inode to struct btrfs_inode
>   btrfs: pass a btrfs_inode to btrfs_ioctl_send()
>   btrfs: switch btrfs_pending_snapshot::dir to btrfs_inode
>   btrfs: switch btrfs_ordered_extent::inode to struct btrfs_inode
>   btrfs: pass a btrfs_inode to btrfs_compress_heuristic()
>   btrfs: pass a btrfs_inode to btrfs_set_prop()
>   btrfs: pass a btrfs_inode to btrfs_load_inode_props()
>   btrfs: pass a btrfs_inode to btrfs_inode_inherit_props()
> 
>  fs/btrfs/bio.c              |  2 +-
>  fs/btrfs/block-group.c      |  4 ++--
>  fs/btrfs/block-group.h      |  2 +-
>  fs/btrfs/btrfs_inode.h      |  4 ++--
>  fs/btrfs/compression.c      |  6 +++---
>  fs/btrfs/compression.h      |  2 +-
>  fs/btrfs/delayed-inode.c    | 12 +++++------
>  fs/btrfs/delayed-inode.h    |  4 ++--
>  fs/btrfs/extent_io.c        |  2 +-
>  fs/btrfs/free-space-cache.c |  4 ++--
>  fs/btrfs/inode.c            | 18 ++++++++--------
>  fs/btrfs/ioctl.c            | 16 +++++++-------
>  fs/btrfs/ordered-data.c     | 22 +++++++++----------
>  fs/btrfs/ordered-data.h     |  2 +-
>  fs/btrfs/props.c            | 43 ++++++++++++++++++-------------------
>  fs/btrfs/props.h            |  8 +++----
>  fs/btrfs/relocation.c       |  2 +-
>  fs/btrfs/send.c             |  4 ++--
>  fs/btrfs/send.h             |  4 ++--
>  fs/btrfs/subpage.c          |  4 ++--
>  fs/btrfs/transaction.c      |  2 +-
>  fs/btrfs/transaction.h      |  2 +-
>  fs/btrfs/xattr.c            |  2 +-
>  fs/btrfs/zoned.c            |  8 +++----
>  24 files changed, 89 insertions(+), 90 deletions(-)
> 
> -- 
> 2.45.0
>
Filipe Manana June 26, 2024, 2:06 p.m. UTC | #2
On Mon, Jun 24, 2024 at 5:24 PM David Sterba <dsterba@suse.com> wrote:
>
> A small batch converting inode to btrfs_inode for internal functions and
> data structures.
>
> David Sterba (11):
>   btrfs: pass a btrfs_inode to btrfs_readdir_put_delayed_items()
>   btrfs: pass a btrfs_inode to btrfs_readdir_get_delayed_items()
>   btrfs: pass a btrfs_inode to is_data_inode()
>   btrfs: switch btrfs_block_group::inode to struct btrfs_inode
>   btrfs: pass a btrfs_inode to btrfs_ioctl_send()
>   btrfs: switch btrfs_pending_snapshot::dir to btrfs_inode
>   btrfs: switch btrfs_ordered_extent::inode to struct btrfs_inode
>   btrfs: pass a btrfs_inode to btrfs_compress_heuristic()
>   btrfs: pass a btrfs_inode to btrfs_set_prop()
>   btrfs: pass a btrfs_inode to btrfs_load_inode_props()
>   btrfs: pass a btrfs_inode to btrfs_inode_inherit_props()

One of these changes to the properties is broken.
btrfs/048 triggers this:

[74513.242475] BUG: kernel NULL pointer dereference, address: 0000000000000208
[74513.242651] #PF: supervisor read access in kernel mode
[74513.242796] #PF: error_code(0x0000) - not-present page
[74513.242935] PGD 0 P4D 0
[74513.243073] Oops: Oops: 0000 [#1] PREEMPT SMP PTI
[74513.243217] CPU: 1 PID: 254085 Comm: btrfs Not tainted
6.10.0-rc5-btrfs-next-164+ #1
[74513.243363] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org 04/01/2014
[74513.243511] RIP: 0010:prop_compression_apply+0x2f/0x150 [btrfs]
[74513.243724] Code: 53 48 89 fb 48 85 d2 0f 84 e7 00 00 00 48 89 f0
48 83 fa 02 74 44 48 83 fa 04 0f 84 f4 00 00 00 48 8b 93 78 fe ff ff
80 38 6c <4c> 8b 82 08 02 00 00 75 53 80 78 01 7a 75 4d 80 78 02 6f 75
47 48
[74513.244038] RSP: 0018:ffffa8a3850c79e0 EFLAGS: 00010246
[74513.244195] RAX: ffff893e8111b468 RBX: ffff893e91f12448 RCX: 0000000000000003
[74513.244353] RDX: 0000000000000000 RSI: ffff893e8111b468 RDI: ffff893e91f12448
[74513.244510] RBP: ffffffffc0c94c00 R08: 000000000000007a R09: 000000000000006f
[74513.244668] R10: ffffa8a3850c7a10 R11: 6e6f697373657270 R12: 0000000000000000
[74513.244827] R13: ffff893e8111b468 R14: ffff893e803ca560 R15: 0000000000000003
[74513.244992] FS:  00007fcaf745c380(0000) GS:ffff8941afc40000(0000)
knlGS:0000000000000000
[74513.245147] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[74513.245302] CR2: 0000000000000208 CR3: 0000000117120006 CR4: 0000000000370ef0
[74513.245464] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[74513.245626] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[74513.245789] Call Trace:
[74513.245955]  <TASK>
[74513.246126]  ? __die_body+0x1b/0x60
[74513.246295]  ? page_fault_oops+0x158/0x4e0
[74513.246463]  ? do_user_addr_fault+0x63/0x820
[74513.246629]  ? exc_page_fault+0x73/0x170
[74513.246796]  ? asm_exc_page_fault+0x22/0x30
[74513.246967]  ? prop_compression_apply+0x2f/0x150 [btrfs]
[74513.247195]  inode_prop_iterator+0x22/0x70 [btrfs]
[74513.247420]  btrfs_load_inode_props+0x2c0/0x330 [btrfs]
[74513.247648]  btrfs_iget_path+0x497/0x700 [btrfs]
[74513.247872]  btrfs_lookup_dentry+0x355/0x5d0 [btrfs]
[74513.248097]  ? d_alloc_parallel+0x2a5/0x400
[74513.248281]  btrfs_lookup+0xe/0x30 [btrfs]
[74513.248509]  __lookup_slow+0x82/0x130
[74513.248703]  walk_component+0xe5/0x160
[74513.248900]  path_lookupat.isra.0+0x6e/0x150
[74513.249092]  filename_lookup+0xc7/0x190
[74513.249285]  ? do_pte_missing+0x86d/0xc50
[74513.249478]  ? __pte_offset_map+0x17/0x140
[74513.249674]  ? preempt_count_add+0x47/0xa0
(...)


>
>  fs/btrfs/bio.c              |  2 +-
>  fs/btrfs/block-group.c      |  4 ++--
>  fs/btrfs/block-group.h      |  2 +-
>  fs/btrfs/btrfs_inode.h      |  4 ++--
>  fs/btrfs/compression.c      |  6 +++---
>  fs/btrfs/compression.h      |  2 +-
>  fs/btrfs/delayed-inode.c    | 12 +++++------
>  fs/btrfs/delayed-inode.h    |  4 ++--
>  fs/btrfs/extent_io.c        |  2 +-
>  fs/btrfs/free-space-cache.c |  4 ++--
>  fs/btrfs/inode.c            | 18 ++++++++--------
>  fs/btrfs/ioctl.c            | 16 +++++++-------
>  fs/btrfs/ordered-data.c     | 22 +++++++++----------
>  fs/btrfs/ordered-data.h     |  2 +-
>  fs/btrfs/props.c            | 43 ++++++++++++++++++-------------------
>  fs/btrfs/props.h            |  8 +++----
>  fs/btrfs/relocation.c       |  2 +-
>  fs/btrfs/send.c             |  4 ++--
>  fs/btrfs/send.h             |  4 ++--
>  fs/btrfs/subpage.c          |  4 ++--
>  fs/btrfs/transaction.c      |  2 +-
>  fs/btrfs/transaction.h      |  2 +-
>  fs/btrfs/xattr.c            |  2 +-
>  fs/btrfs/zoned.c            |  8 +++----
>  24 files changed, 89 insertions(+), 90 deletions(-)
>
> --
> 2.45.0
>
>
David Sterba June 26, 2024, 2:39 p.m. UTC | #3
On Wed, Jun 26, 2024 at 03:06:29PM +0100, Filipe Manana wrote:
> On Mon, Jun 24, 2024 at 5:24 PM David Sterba <dsterba@suse.com> wrote:
> >
> > A small batch converting inode to btrfs_inode for internal functions and
> > data structures.
> >
> > David Sterba (11):
> >   btrfs: pass a btrfs_inode to btrfs_readdir_put_delayed_items()
> >   btrfs: pass a btrfs_inode to btrfs_readdir_get_delayed_items()
> >   btrfs: pass a btrfs_inode to is_data_inode()
> >   btrfs: switch btrfs_block_group::inode to struct btrfs_inode
> >   btrfs: pass a btrfs_inode to btrfs_ioctl_send()
> >   btrfs: switch btrfs_pending_snapshot::dir to btrfs_inode
> >   btrfs: switch btrfs_ordered_extent::inode to struct btrfs_inode
> >   btrfs: pass a btrfs_inode to btrfs_compress_heuristic()
> >   btrfs: pass a btrfs_inode to btrfs_set_prop()
> >   btrfs: pass a btrfs_inode to btrfs_load_inode_props()
> >   btrfs: pass a btrfs_inode to btrfs_inode_inherit_props()
> 
> One of these changes to the properties is broken.
> btrfs/048 triggers this:

Thanks for the report, I'll take a look.