From 7744e65aec9a5caaadd4c8efe9a3d8117549223f Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Tue, 12 Jul 2011 13:42:01 -0400 Subject: [PATCH] --- yaml --- r: 260852 b: refs/heads/master c: 87ed5eb44ad9338b1617a0e78dea81d681325298 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/nfs/write.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 64906efa0648..da8bf22801e7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c47abcf8ff4d0c56d20ce541e80d3e1c975f54b5 +refs/heads/master: 87ed5eb44ad9338b1617a0e78dea81d681325298 diff --git a/trunk/fs/nfs/write.c b/trunk/fs/nfs/write.c index 7f8732e31982..1af4d82c4959 100644 --- a/trunk/fs/nfs/write.c +++ b/trunk/fs/nfs/write.c @@ -872,10 +872,14 @@ static int nfs_write_rpcsetup(struct nfs_page *req, data->args.context = get_nfs_open_context(req->wb_context); data->args.lock_context = req->wb_lock_context; data->args.stable = NFS_UNSTABLE; - if (how & (FLUSH_STABLE | FLUSH_COND_STABLE)) { - data->args.stable = NFS_DATA_SYNC; - if (!nfs_need_commit(NFS_I(inode))) - data->args.stable = NFS_FILE_SYNC; + switch (how & (FLUSH_STABLE | FLUSH_COND_STABLE)) { + case 0: + break; + case FLUSH_COND_STABLE: + if (nfs_need_commit(NFS_I(inode))) + break; + default: + data->args.stable = NFS_FILE_SYNC; } data->res.fattr = &data->fattr;