Skip to content

Commit

Permalink
Merge tag 'for-6.6-rc5-tag' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/kdave/linux

Pull btrfs fixes from David Sterba:
 "A revert of recent mount option parsing fix, this breaks mounts with
  security options.

  The second patch is a flexible array annotation"

* tag 'for-6.6-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  btrfs: add __counted_by for struct btrfs_delayed_item and use struct_size()
  Revert "btrfs: reject unknown mount options early"
  • Loading branch information
Linus Torvalds committed Oct 11, 2023
2 parents 8182d7a + 75f5f60 commit 759d1b6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fs/btrfs/delayed-inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static struct btrfs_delayed_item *btrfs_alloc_delayed_item(u16 data_len,
{
struct btrfs_delayed_item *item;

item = kmalloc(sizeof(*item) + data_len, GFP_NOFS);
item = kmalloc(struct_size(item, data, data_len), GFP_NOFS);
if (item) {
item->data_len = data_len;
item->type = type;
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/delayed-inode.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct btrfs_delayed_item {
bool logged;
/* The maximum leaf size is 64K, so u16 is more than enough. */
u16 data_len;
char data[];
char data[] __counted_by(data_len);
};

static inline void btrfs_init_delayed_root(
Expand Down
4 changes: 0 additions & 4 deletions fs/btrfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,10 +954,6 @@ static int btrfs_parse_subvol_options(const char *options, char **subvol_name,

*subvol_objectid = subvolid;
break;
case Opt_err:
btrfs_err(NULL, "unrecognized mount option '%s'", p);
error = -EINVAL;
goto out;
default:
break;
}
Expand Down

0 comments on commit 759d1b6

Please sign in to comment.