diff options
Diffstat (limited to 'fs/nfsd/nfs4acl.c')
-rw-r--r-- | fs/nfsd/nfs4acl.c | 48 |
1 files changed, 21 insertions, 27 deletions
diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c index 59fdd9c1d3ee..105544eac9a3 100644 --- a/fs/nfsd/nfs4acl.c +++ b/fs/nfsd/nfs4acl.c | |||
@@ -360,39 +360,33 @@ nfs4_acl_nfsv4_to_posix(struct nfs4_acl *acl, struct posix_acl **pacl, | |||
360 | if (error < 0) | 360 | if (error < 0) |
361 | goto out_acl; | 361 | goto out_acl; |
362 | 362 | ||
363 | if (pacl != NULL) { | 363 | if (acl->naces == 0) { |
364 | if (acl->naces == 0) { | 364 | error = -ENODATA; |
365 | error = -ENODATA; | 365 | goto try_dpacl; |
366 | goto try_dpacl; | ||
367 | } | ||
368 | |||
369 | *pacl = _nfsv4_to_posix_one(acl, flags); | ||
370 | if (IS_ERR(*pacl)) { | ||
371 | error = PTR_ERR(*pacl); | ||
372 | *pacl = NULL; | ||
373 | goto out_acl; | ||
374 | } | ||
375 | } | 366 | } |
376 | 367 | ||
368 | *pacl = _nfsv4_to_posix_one(acl, flags); | ||
369 | if (IS_ERR(*pacl)) { | ||
370 | error = PTR_ERR(*pacl); | ||
371 | *pacl = NULL; | ||
372 | goto out_acl; | ||
373 | } | ||
377 | try_dpacl: | 374 | try_dpacl: |
378 | if (dpacl != NULL) { | 375 | if (dacl->naces == 0) { |
379 | if (dacl->naces == 0) { | 376 | if (pacl == NULL || *pacl == NULL) |
380 | if (pacl == NULL || *pacl == NULL) | 377 | error = -ENODATA; |
381 | error = -ENODATA; | 378 | goto out_acl; |
382 | goto out_acl; | ||
383 | } | ||
384 | |||
385 | error = 0; | ||
386 | *dpacl = _nfsv4_to_posix_one(dacl, flags); | ||
387 | if (IS_ERR(*dpacl)) { | ||
388 | error = PTR_ERR(*dpacl); | ||
389 | *dpacl = NULL; | ||
390 | goto out_acl; | ||
391 | } | ||
392 | } | 379 | } |
393 | 380 | ||
381 | error = 0; | ||
382 | *dpacl = _nfsv4_to_posix_one(dacl, flags); | ||
383 | if (IS_ERR(*dpacl)) { | ||
384 | error = PTR_ERR(*dpacl); | ||
385 | *dpacl = NULL; | ||
386 | goto out_acl; | ||
387 | } | ||
394 | out_acl: | 388 | out_acl: |
395 | if (error && pacl) { | 389 | if (error) { |
396 | posix_acl_release(*pacl); | 390 | posix_acl_release(*pacl); |
397 | *pacl = NULL; | 391 | *pacl = NULL; |
398 | } | 392 | } |