Skip to content

Commit

Permalink
linux: don't fall through to 3-arg vfs_getattr
Browse files Browse the repository at this point in the history
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12103
  • Loading branch information
nabijaczleweli authored and behlendorf committed May 26, 2021
1 parent a1ca396 commit 202498c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion module/os/linux/spl/spl-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,10 @@ spl_getattr(struct file *filp, struct kstat *stat)
AT_STATX_SYNC_AS_STAT);
#elif defined(HAVE_2ARGS_VFS_GETATTR)
rc = vfs_getattr(&filp->f_path, stat);
#else
#elif defined(HAVE_3ARGS_VFS_GETATTR)
rc = vfs_getattr(filp->f_path.mnt, filp->f_dentry, stat);
#else
#error "No available vfs_getattr()"
#endif
if (rc)
return (-rc);
Expand Down
4 changes: 3 additions & 1 deletion module/os/linux/zfs/zfs_file_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,10 @@ zfs_file_getattr(zfs_file_t *filp, zfs_file_attr_t *zfattr)
AT_STATX_SYNC_AS_STAT);
#elif defined(HAVE_2ARGS_VFS_GETATTR)
rc = vfs_getattr(&filp->f_path, &stat);
#else
#elif defined(HAVE_3ARGS_VFS_GETATTR)
rc = vfs_getattr(filp->f_path.mnt, filp->f_dentry, &stat);
#else
#error "No available vfs_getattr()"
#endif
if (rc)
return (-rc);
Expand Down

0 comments on commit 202498c

Please sign in to comment.