lkml.org 
[lkml]   [2014]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.14 075/158] nfsd: notify_change needs elevated write count
    Date
    3.14-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: "J. Bruce Fields" <bfields@redhat.com>

    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@rapitasystems.com>
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    fs/nfsd/vfs.c | 9 +++++++++
    1 file changed, 9 insertions(+)

    --- a/fs/nfsd/vfs.c
    +++ b/fs/nfsd/vfs.c
    @@ -404,6 +404,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))
    @@ -411,10 +412,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;



    \
     
     \ /
      Last update: 2014-05-04 19:41    [W:4.904 / U:0.260 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site