Skip to content

Commit 759d1b6

Browse files
committed
Merge tag 'for-6.6-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/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"
2 parents 8182d7a + 75f5f60 commit 759d1b6

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

fs/btrfs/delayed-inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ static struct btrfs_delayed_item *btrfs_alloc_delayed_item(u16 data_len,
313313
{
314314
struct btrfs_delayed_item *item;
315315

316-
item = kmalloc(sizeof(*item) + data_len, GFP_NOFS);
316+
item = kmalloc(struct_size(item, data, data_len), GFP_NOFS);
317317
if (item) {
318318
item->data_len = data_len;
319319
item->type = type;

fs/btrfs/delayed-inode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ struct btrfs_delayed_item {
9595
bool logged;
9696
/* The maximum leaf size is 64K, so u16 is more than enough. */
9797
u16 data_len;
98-
char data[];
98+
char data[] __counted_by(data_len);
9999
};
100100

101101
static inline void btrfs_init_delayed_root(

fs/btrfs/super.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -954,10 +954,6 @@ static int btrfs_parse_subvol_options(const char *options, char **subvol_name,
954954

955955
*subvol_objectid = subvolid;
956956
break;
957-
case Opt_err:
958-
btrfs_err(NULL, "unrecognized mount option '%s'", p);
959-
error = -EINVAL;
960-
goto out;
961957
default:
962958
break;
963959
}

0 commit comments

Comments
 (0)