]> git.ipfire.org Git - people/ms/linux.git/commit
nfs: fix size updates for aio writes
authorChristoph Hellwig <hch@infradead.org>
Thu, 14 Nov 2013 16:50:28 +0000 (08:50 -0800)
committerJiri Slaby <jslaby@suse.cz>
Thu, 3 Apr 2014 08:32:14 +0000 (10:32 +0200)
commit2fae4cc0d0b46c9ee3b95dfd0d22055066a71736
treea0bd39323148c8db0fe2d5feebbc77999e1d775d
parent2e3b72ab7008ddfad528d2711a8f95c9ef942f7b
nfs: fix size updates for aio writes

commit 9811cd57f4c6b5b60ec104de68a88303717e3106 upstream.

nfs_file_direct_write only updates the inode size if it succeeded and
returned the number of bytes written.  But in the AIO case nfs_direct_wait
turns the return value into -EIOCBQUEUED and we skip the size update.

Instead the aio completion path should updated it, which this patch
does.  The implementation is a little hacky because there is no obvious
way to find out we are called for a write in nfs_direct_complete.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/nfs/direct.c