Skip to contentSkip to conversation

GFS2: gfs2_set_acl(): Cache "no acl" as well

PATCH New Andreas Gruenbacher 2 participants 2 messages Feb 12, 2015 – Feb 23, 2015 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 GFS2: gfs2_set_acl(): Cache "no acl" as well

When removing a default acl or setting an access acl that is entirely represented in the file mode, we end up with acl == NULL in gfs2_set_acl(). In that case, bring gfs2 in line with other file systems and cache the NULL acl with set_cached_acl() instead of invalidating the cache with forget_cached_acl().

---
 fs/gfs2/acl.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
fs/gfs2/acl.c +1 -5
index 7b31430..1be3b06 100644
@@ -110,11 +110,7 @@ int gfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
 	error = __gfs2_xattr_set(inode, name, data, len, 0, GFS2_EATYPE_SYS);
 	if (error)
 		goto out;
-
-	if (acl)
-		set_cached_acl(inode, type, acl);
-	else
-		forget_cached_acl(inode, type);
+	set_cached_acl(inode, type, acl);
 out:
 	kfree(data);
 	return error;
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/1 GFS2: gfs2_set_acl(): Cache "no acl" as well

Hi,

Now in the for-next tree of the linux-gfs2.git repo.

Regards,

Bob Peterson

----- Original Message -----

Quoted 34 lines

When removing a default acl or setting an access acl that is entirely represented in the file mode, we end up with acl == NULL in gfs2_set_acl(). In
that case, bring gfs2 in line with other file systems and cache the NULL acl with set_cached_acl() instead of invalidating the cache with forget_cached_acl().

---
 fs/gfs2/acl.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
fs/gfs2/acl.c +1 -5
index 7b31430..1be3b06 100644
@@ -110,11 +110,7 @@ int gfs2_set_acl(struct inode *inode, struct posix_acl
 *acl, int type)
 	error = __gfs2_xattr_set(inode, name, data, len, 0, GFS2_EATYPE_SYS);
 	if (error)
 		goto out;
-
-	if (acl)
-		set_cached_acl(inode, type, acl);
-	else
-		forget_cached_acl(inode, type);
+	set_cached_acl(inode, type, acl);
 out:
 	kfree(data);

return error;
--
2.1.0