| .. | .. |
|---|
| 14 | 14 | #include "nfsd.h" |
|---|
| 15 | 15 | #include "vfs.h" |
|---|
| 16 | 16 | #include "auth.h" |
|---|
| 17 | +#include "trace.h" |
|---|
| 17 | 18 | |
|---|
| 18 | 19 | #define NFSDDBG_FACILITY NFSDDBG_FH |
|---|
| 19 | 20 | |
|---|
| .. | .. |
|---|
| 209 | 210 | } |
|---|
| 210 | 211 | |
|---|
| 211 | 212 | error = nfserr_stale; |
|---|
| 212 | | - if (PTR_ERR(exp) == -ENOENT) |
|---|
| 213 | | - return error; |
|---|
| 213 | + if (IS_ERR(exp)) { |
|---|
| 214 | + trace_nfsd_set_fh_dentry_badexport(rqstp, fhp, PTR_ERR(exp)); |
|---|
| 214 | 215 | |
|---|
| 215 | | - if (IS_ERR(exp)) |
|---|
| 216 | + if (PTR_ERR(exp) == -ENOENT) |
|---|
| 217 | + return error; |
|---|
| 218 | + |
|---|
| 216 | 219 | return nfserrno(PTR_ERR(exp)); |
|---|
| 220 | + } |
|---|
| 217 | 221 | |
|---|
| 218 | 222 | if (exp->ex_flags & NFSEXP_NOSUBTREECHECK) { |
|---|
| 219 | 223 | /* Elevate privileges so that the lack of 'r' or 'x' |
|---|
| .. | .. |
|---|
| 267 | 271 | dentry = exportfs_decode_fh(exp->ex_path.mnt, fid, |
|---|
| 268 | 272 | data_left, fileid_type, |
|---|
| 269 | 273 | nfsd_acceptable, exp); |
|---|
| 274 | + if (IS_ERR_OR_NULL(dentry)) |
|---|
| 275 | + trace_nfsd_set_fh_dentry_badhandle(rqstp, fhp, |
|---|
| 276 | + dentry ? PTR_ERR(dentry) : -ESTALE); |
|---|
| 270 | 277 | } |
|---|
| 271 | 278 | if (dentry == NULL) |
|---|
| 272 | 279 | goto out; |
|---|
| .. | .. |
|---|
| 452 | 459 | case FSID_DEV: |
|---|
| 453 | 460 | if (!old_valid_dev(exp_sb(exp)->s_dev)) |
|---|
| 454 | 461 | return false; |
|---|
| 455 | | - /* FALL THROUGH */ |
|---|
| 462 | + fallthrough; |
|---|
| 456 | 463 | case FSID_MAJOR_MINOR: |
|---|
| 457 | 464 | case FSID_ENCODE_DEV: |
|---|
| 458 | 465 | return exp_sb(exp)->s_type->fs_flags & FS_REQUIRES_DEV; |
|---|
| .. | .. |
|---|
| 462 | 469 | case FSID_UUID16: |
|---|
| 463 | 470 | if (!is_root_export(exp)) |
|---|
| 464 | 471 | return false; |
|---|
| 465 | | - /* fall through */ |
|---|
| 472 | + fallthrough; |
|---|
| 466 | 473 | case FSID_UUID4_INUM: |
|---|
| 467 | 474 | case FSID_UUID16_INUM: |
|---|
| 468 | 475 | return exp->ex_uuid != NULL; |
|---|