diff --git a/fs/posix_acl.c b/fs/posix_acl.c index d7bc81fc0840..420c689e1bec 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c @@ -174,7 +174,7 @@ static struct posix_acl *__get_acl(struct user_namespace *mnt_userns, * Cache the result, but only if our sentinel is still in place. */ posix_acl_dup(acl); - if (unlikely(cmpxchg(p, sentinel, acl) != sentinel)) + if (unlikely(!try_cmpxchg(p, &sentinel, acl))) posix_acl_release(acl); return acl; }