.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) International Business Machines Corp., 2002-2004 |
---|
3 | 4 | * Copyright (C) Andreas Gruenbacher, 2001 |
---|
4 | 5 | * 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 |
---|
19 | 6 | */ |
---|
20 | 7 | |
---|
21 | 8 | #include <linux/sched.h> |
---|
.. | .. |
---|
117 | 104 | rc = posix_acl_update_mode(inode, &mode, &acl); |
---|
118 | 105 | if (rc) |
---|
119 | 106 | goto end_tx; |
---|
120 | | - update_mode = 1; |
---|
| 107 | + if (mode != inode->i_mode) |
---|
| 108 | + update_mode = 1; |
---|
121 | 109 | } |
---|
122 | 110 | rc = __jfs_set_acl(tid, inode, type, acl); |
---|
123 | 111 | if (!rc) { |
---|
.. | .. |
---|
146 | 134 | if (default_acl) { |
---|
147 | 135 | rc = __jfs_set_acl(tid, inode, ACL_TYPE_DEFAULT, default_acl); |
---|
148 | 136 | posix_acl_release(default_acl); |
---|
| 137 | + } else { |
---|
| 138 | + inode->i_default_acl = NULL; |
---|
149 | 139 | } |
---|
150 | 140 | |
---|
151 | 141 | if (acl) { |
---|
152 | 142 | if (!rc) |
---|
153 | 143 | rc = __jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, acl); |
---|
154 | 144 | posix_acl_release(acl); |
---|
| 145 | + } else { |
---|
| 146 | + inode->i_acl = NULL; |
---|
155 | 147 | } |
---|
156 | 148 | |
---|
157 | 149 | JFS_IP(inode)->mode2 = (JFS_IP(inode)->mode2 & 0xffff0000) | |
---|