Merge tag 'exfat-for-6.7-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-block.git] / fs / fhandle.c
index 6ea8d35a9382ace3fac22b89c818c74f0f123c34..18b3ba8dc8ead7c6016a1f76d96275268b0667f0 100644 (file)
@@ -26,12 +26,8 @@ static long do_sys_name_to_handle(const struct path *path,
        /*
         * We need to make sure whether the file system support decoding of
         * the file handle if decodeable file handle was requested.
-        * Otherwise, even empty export_operations are sufficient to opt-in
-        * to encoding FIDs.
         */
-       if (!path->dentry->d_sb->s_export_op ||
-           (!(fh_flags & EXPORT_FH_FID) &&
-            !path->dentry->d_sb->s_export_op->fh_to_dentry))
+       if (!exportfs_can_encode_fh(path->dentry->d_sb->s_export_op, fh_flags))
                return -EOPNOTSUPP;
 
        if (copy_from_user(&f_handle, ufh, sizeof(struct file_handle)))