linux: don't fall through to 3-arg vfs_getattr

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
This commit is contained in:
наб 2021-05-26 00:44:09 +02:00 committed by Brian Behlendorf
parent a1ca39655b
commit 202498c958
2 changed files with 6 additions and 2 deletions

View File

@ -586,8 +586,10 @@ spl_getattr(struct file *filp, struct kstat *stat)
AT_STATX_SYNC_AS_STAT); AT_STATX_SYNC_AS_STAT);
#elif defined(HAVE_2ARGS_VFS_GETATTR) #elif defined(HAVE_2ARGS_VFS_GETATTR)
rc = vfs_getattr(&filp->f_path, stat); 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); rc = vfs_getattr(filp->f_path.mnt, filp->f_dentry, stat);
#else
#error "No available vfs_getattr()"
#endif #endif
if (rc) if (rc)
return (-rc); return (-rc);

View File

@ -279,8 +279,10 @@ zfs_file_getattr(zfs_file_t *filp, zfs_file_attr_t *zfattr)
AT_STATX_SYNC_AS_STAT); AT_STATX_SYNC_AS_STAT);
#elif defined(HAVE_2ARGS_VFS_GETATTR) #elif defined(HAVE_2ARGS_VFS_GETATTR)
rc = vfs_getattr(&filp->f_path, &stat); 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); rc = vfs_getattr(filp->f_path.mnt, filp->f_dentry, &stat);
#else
#error "No available vfs_getattr()"
#endif #endif
if (rc) if (rc)
return (-rc); return (-rc);