NFS: Zero-stateid SETATTR should first return delegation
[sfrench/cifs-2.6.git] / fs / nfs / nfs4proc.c
index 4a6cfb497103a3de116b6efd7c3aff613612b7b7..3e824110b47038b733e043f8ad5616eddc4d11ca 100644 (file)
@@ -3293,8 +3293,10 @@ static int _nfs4_do_setattr(struct inode *inode,
 
        /* Servers should only apply open mode checks for file size changes */
        truncate = (arg->iap->ia_valid & ATTR_SIZE) ? true : false;
-       if (!truncate)
+       if (!truncate) {
+               nfs4_inode_make_writeable(inode);
                goto zero_stateid;
+       }
 
        if (nfs4_copy_delegation_stateid(inode, FMODE_WRITE, &arg->stateid, &delegation_cred)) {
                /* Use that stateid */