From mboxrd@z Thu Jan 1 00:00:00 1970 From: walter harms Date: Mon, 13 May 2019 10:13:39 +0000 Subject: Re: [PATCH 2/2] afs: Fix afs_xattr_get_yfs() to not try freeing an error value Message-Id: <5CD94353.90702@bfs.de> List-Id: References: <5CD8697B.6010004@bfs.de> <5CD844B0.5060206@bfs.de> <155764714099.24080.1233326575922058381.stgit@warthog.procyon.org.uk> <155764714872.24080.15171754166782593095.stgit@warthog.procyon.org.uk> <31808.1557684645@warthog.procyon.org.uk> <6819.1557691584@warthog.procyon.org.uk> In-Reply-To: <6819.1557691584@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: David Howells Cc: jaltman@auristor.com, linux-afs@lists.infradead.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Am 12.05.2019 22:06, schrieb David Howells: > walter harms wrote: > >> Sorry, you misunderstood me, my fault, i did not see that size is unsigned. >> NTL i do not think size=0 is useful. > > Allow me to quote from the getxattr manpage: > > If size is specified as zero, these calls return the current size of > the named extended attribute (and leave value unchanged). This can be > used to determine the size of the buffer that should be supplied in a > subsequent call. [...] > ok, sorry for the noise i did not know, for me that look unintended. >> while you are there: >> flags |= YFS_ACL_WANT_ACL is always flags = YFS_ACL_WANT_ACL; >> since flags is 0 at this point. >> IMHO that sould be moved to the strcmp() section. > > Why? It makes the strcmp() section more complicated and means I now either > have to cache flags in a variable or do the allocation of yacl first. > no need to cache, the idea was only to make the correlation between the name and flags more obvious. (no need to hurry, i just noticed it) if (strcmp(name, "acl") = 0) { which = 0; flags = YFS_ACL_WANT_ACL; } else if (strcmp(name, "acl_inherited") = 0) { which = 1; flags = 0; } else if (strcmp(name, "acl_num_cleaned") = 0) { which = 2; flags = 0; } else if (strcmp(name, "vol_acl") = 0) { which = 3; flags = YFS_ACL_WANT_VOL_ACL; } .... re, wh > David >