diff options
-rw-r--r-- | xlators/nfs/server/src/nfs3.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c index 3ecd9749826..9b756712b74 100644 --- a/xlators/nfs/server/src/nfs3.c +++ b/xlators/nfs/server/src/nfs3.c @@ -971,7 +971,8 @@ nfs3svc_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, * truncation and also only if this is not a directory. */ if ((gf_attr_size_set (cs->setattr_valid)) && - (!IA_ISDIR (postop->ia_type))) { + (!IA_ISDIR (postop->ia_type)) && + (preop->ia_size != cs->stbuf.ia_size)) { nfs_request_user_init (&nfu, cs->req); ret = nfs_truncate (cs->nfsx, cs->vol, &nfu, &cs->resolvedloc, cs->stbuf.ia_size, nfs3svc_truncate_cbk,cs); |