xfs
[Top] [All Lists]

Re: [PATCH 3/4] xfs: SGI ACLs: Map uid/gid namespaces

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 3/4] xfs: SGI ACLs: Map uid/gid namespaces
From: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
Date: Tue, 27 Oct 2015 16:55:22 +0100
Cc: Brian Foster <bfoster@xxxxxxxxxx>, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat_com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Y43908fZ0oUm6DidONWYSjcP3uzUj6dgCqeJKdN0bGs=; b=SXYFU1p9MFRVMjKb0Ar4wjCHxCcJD+lL6VkpU8iW1F7EoTciy9k+BoyvBtiuQ/3xnO 2+NIyIBQPQquS7wOi0S4VwMbXNPZqAcF1Bc98wXqy0IX2aAQHrYM8/hD5MB4QXH+pCTw Mnv+gkcIBAQyYaYQhaFnoao7H7618UYOJNqI+6e0TJJKzxUPTV0dcdaGDQleOwLWh/yM gOTyORj9mH/tS9tNH8o8h+e5GQJ1lkCLAtnLxqyHZ/sKF7eguiEPIZ2U8wy3XfU6liv4 9L0VyPA4RBaxTBKbmX8PKDsmA+JCsUubBvhaMrr7XezNIRbcQfBDJSuz58kEL5dNA3/h q7CQ==
In-reply-to: <20151026214651.GJ8773@dastard>
References: <1445721369-25679-1-git-send-email-agruenba@xxxxxxxxxx> <1445721369-25679-4-git-send-email-agruenba@xxxxxxxxxx> <20151026214651.GJ8773@dastard>
On Mon, Oct 26, 2015 at 10:46 PM, Dave Chinner <david@xxxxxxxxxxxxx> wrote:
> On Sat, Oct 24, 2015 at 11:16:08PM +0200, Andreas Gruenbacher wrote:
>> @@ -71,10 +72,10 @@ xfs_acl_from_disk(
>>
>>               switch (acl_e->e_tag) {
>>               case ACL_USER:
>> -                     acl_e->e_uid = 
>> xfs_uid_to_kuid(be32_to_cpu(ace->ae_id));
>> +                     acl_e->e_uid = make_kuid(ns, be32_to_cpu(ace->ae_id));
>
> Please don't replace the xfs wrappers with the horribly named
> generic functions. Pass the namespace to xfs_uid_to_kuid(), and
> modify them, please. That way people who don't deal with namespaces
> every day can tell exactly what format conversion is taking place
> just by reading the code...

We would effectively end up with:

  #define xfs_kuid_to_uid from_kuid
  #define xfs_kgid_to_gid from_kgid
  #define xfs_uid_to_kuid make_kuid
  #define xfs_gid_to_kgid make_kgid

Are you sure you really want that?

> This namespace stuff is awful twisty. The posix layer does a user-ns
> to init-ns conversion and here we do a no-op init-ns to init-ns
> conversion. That needs comments in the code to explain exactly why
> one path needs user-ns conversion and the other doesn't, because I'm
> sure as hell not going to remember why these code paths are
> different in 6 months time.

Okay.

Thanks,
Andreas

<Prev in Thread] Current Thread [Next in Thread>