Skip to content

Commit 62d1cea

Browse files
committed
Merge tag 'nfsd-6.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
Pull nfsd fix from Chuck Lever: "Address an NFSD regression introduced during the 6.0 merge window" * tag 'nfsd-6.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: NFSD: fix regression with setting ACLs.
2 parents 80e78fc + 00801cd commit 62d1cea

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

fs/nfsd/vfs.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@ commit_metadata(struct svc_fh *fhp)
300300
static void
301301
nfsd_sanitize_attrs(struct inode *inode, struct iattr *iap)
302302
{
303+
/* Ignore mode updates on symlinks */
304+
if (S_ISLNK(inode->i_mode))
305+
iap->ia_valid &= ~ATTR_MODE;
306+
303307
/* sanitize the mode change */
304308
if (iap->ia_valid & ATTR_MODE) {
305309
iap->ia_mode &= S_IALLUGO;
@@ -353,7 +357,7 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp,
353357
int accmode = NFSD_MAY_SATTR;
354358
umode_t ftype = 0;
355359
__be32 err;
356-
int host_err;
360+
int host_err = 0;
357361
bool get_write_count;
358362
bool size_change = (iap->ia_valid & ATTR_SIZE);
359363

@@ -391,13 +395,6 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp,
391395
dentry = fhp->fh_dentry;
392396
inode = d_inode(dentry);
393397

394-
/* Ignore any mode updates on symlinks */
395-
if (S_ISLNK(inode->i_mode))
396-
iap->ia_valid &= ~ATTR_MODE;
397-
398-
if (!iap->ia_valid)
399-
return 0;
400-
401398
nfsd_sanitize_attrs(inode, iap);
402399

403400
if (check_guard && guardtime != inode->i_ctime.tv_sec)
@@ -448,8 +445,10 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp,
448445
goto out_unlock;
449446
}
450447

451-
iap->ia_valid |= ATTR_CTIME;
452-
host_err = notify_change(&init_user_ns, dentry, iap, NULL);
448+
if (iap->ia_valid) {
449+
iap->ia_valid |= ATTR_CTIME;
450+
host_err = notify_change(&init_user_ns, dentry, iap, NULL);
451+
}
453452

454453
out_unlock:
455454
if (attr->na_seclabel && attr->na_seclabel->len)

0 commit comments

Comments
 (0)