hc
2024-09-20 a36159eec6ca17402b0e146b86efaf76568dc353
kernel/fs/jfs/acl.c
....@@ -1,21 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) International Business Machines Corp., 2002-2004
34 * Copyright (C) Andreas Gruenbacher, 2001
45 * Copyright (C) Linus Torvalds, 1991, 1992
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
14
- * the GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
196 */
207
218 #include <linux/sched.h>
....@@ -117,7 +104,8 @@
117104 rc = posix_acl_update_mode(inode, &mode, &acl);
118105 if (rc)
119106 goto end_tx;
120
- update_mode = 1;
107
+ if (mode != inode->i_mode)
108
+ update_mode = 1;
121109 }
122110 rc = __jfs_set_acl(tid, inode, type, acl);
123111 if (!rc) {
....@@ -146,12 +134,16 @@
146134 if (default_acl) {
147135 rc = __jfs_set_acl(tid, inode, ACL_TYPE_DEFAULT, default_acl);
148136 posix_acl_release(default_acl);
137
+ } else {
138
+ inode->i_default_acl = NULL;
149139 }
150140
151141 if (acl) {
152142 if (!rc)
153143 rc = __jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, acl);
154144 posix_acl_release(acl);
145
+ } else {
146
+ inode->i_acl = NULL;
155147 }
156148
157149 JFS_IP(inode)->mode2 = (JFS_IP(inode)->mode2 & 0xffff0000) |