]> git.karo-electronics.de Git - linux-beck.git/commitdiff
NFSv4: Don't call update_changeattr() unless the unlink is successful
authorTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 11 Jan 2017 17:36:11 +0000 (12:36 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 12 Jan 2017 20:51:18 +0000 (15:51 -0500)
If the unlink wasn't successful, then the directory has presumably not
changed.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/nfs4proc.c

index 1e797bf74aaf8cdb7df39977e39adf53e5fedaba..6a35204affa47bb796d368c0a21c4e2b443f17ba 100644 (file)
@@ -4125,7 +4125,8 @@ static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir)
        if (nfs4_async_handle_error(task, res->server, NULL,
                                    &data->timeout) == -EAGAIN)
                return 0;
-       update_changeattr(dir, &res->cinfo);
+       if (task->tk_status == 0)
+               update_changeattr(dir, &res->cinfo);
        return 1;
 }