ANDROID: fuse: fix struct path zero initialization

It seems gcc is too strict and doesn't recognize {0} as a valid implicit
zero initialization for structs with randomize layouts. This triggers
the following build issue:

  ./include/linux/fsnotify.h:105:51: error: positional initialization of
      field in ‘struct’ declared with ‘designated_init’ attribute
      [-Werror=designated-init]
    105 |                         struct path lower_path = {0};

Instead of calling for the first positional member to be explicitly zero
use {} as a zero initializer for the whole struct and make gcc happy.

Fixes: 44a94ece47 ("ANDROID: fuse: Support errors from fuse daemon in canonical path")
Change-Id: I6b474f44657b5add16a8df5fdb3a4a0919377c2c
Signed-off-by: Carlos Llamas <cmllamas@google.com>
This commit is contained in:
Carlos Llamas
2023-03-29 14:20:03 +00:00
committed by Todd Kjos
parent ee002ea6ad
commit f3a30a028e
2 changed files with 2 additions and 2 deletions

View File

@@ -712,7 +712,7 @@ SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname,
struct fsnotify_group *group;
struct inode *inode;
struct path path;
struct path alteredpath = {0};
struct path alteredpath = {};
struct path *canonical_path = &path;
struct fd f;
int ret;

View File

@@ -102,7 +102,7 @@ static inline int fsnotify_file(struct file *file, __u32 mask)
if (mask & FS_OPEN) {
if (path->dentry->d_op &&
path->dentry->d_op->d_canonical_path) {
struct path lower_path = {0};
struct path lower_path = {};
int ret;
path->dentry->d_op->d_canonical_path(path, &lower_path);