This is a note to let you know that I've just added the patch titled nfsd: notify_change needs elevated write count to the 3.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: nfsd-notify_change-needs-elevated-write-count.patch and it can be found in the queue-3.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 9f67f189939eccaa54f3d2c9cf10788abaf2d584 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" <bfields@xxxxxxxxxx> Date: Mon, 24 Feb 2014 14:59:47 -0500 Subject: nfsd: notify_change needs elevated write count From: "J. Bruce Fields" <bfields@xxxxxxxxxx> commit 9f67f189939eccaa54f3d2c9cf10788abaf2d584 upstream. Looks like this bug has been here since these write counts were introduced, not sure why it was just noticed now. Thanks also to Jan Kara for pointing out the problem. Reported-by: Matthew Rahtz <mrahtz@xxxxxxxxxxxxxxxxx> Signed-off-by: J. Bruce Fields <bfields@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/nfsd/vfs.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -406,6 +406,7 @@ nfsd_setattr(struct svc_rqst *rqstp, str umode_t ftype = 0; __be32 err; int host_err; + bool get_write_count; int size_change = 0; if (iap->ia_valid & (ATTR_ATIME | ATTR_MTIME | ATTR_SIZE)) @@ -413,10 +414,18 @@ nfsd_setattr(struct svc_rqst *rqstp, str if (iap->ia_valid & ATTR_SIZE) ftype = S_IFREG; + /* Callers that do fh_verify should do the fh_want_write: */ + get_write_count = !fhp->fh_dentry; + /* Get inode */ err = fh_verify(rqstp, fhp, ftype, accmode); if (err) goto out; + if (get_write_count) { + host_err = fh_want_write(fhp); + if (host_err) + return nfserrno(host_err); + } dentry = fhp->fh_dentry; inode = dentry->d_inode; Patches currently in stable-queue which might be from bfields@xxxxxxxxxx are queue-3.10/nfsd4-fix-test_stateid-error-reply-encoding.patch queue-3.10/nfsd4-fix-setclientid-encode-size.patch queue-3.10/nfsd-set-timeparms.to_maxval-in-setup_callback_client.patch queue-3.10/nfsd4-session-needs-room-for-following-op-to-error-out.patch queue-3.10/nfsd4-buffer-length-check-for-suppattr_exclcreat.patch queue-3.10/nfsd-check-passed-socket-s-net-matches-nfsd-superblock-s-one.patch queue-3.10/nfsd-notify_change-needs-elevated-write-count.patch queue-3.10/nfsd-traverse-unconfirmed-client-through-hash-table.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html