[linux-cifs-client] Re: [PATCH] cifs: make cifs_writepages use longer timeout

Steve French smfrench at gmail.com
Thu Apr 2 18:15:39 GMT 2009


When file is extended in write we could save the (previous) offset in
cifs_file struct ...?  And then increase the saved offset to match the
last write (past previous end of file).   Whenever we attempt a write
more than a few megabytes past the saved range, we can use long op?
Thoughts?

On Thu, Apr 2, 2009 at 10:32 AM, Jeff Layton <jlayton at redhat.com> wrote:
> We've had a lot of changes to the socket sending and buffered write code
> in recent months and I've just noticed some breakage due to it. The
> "bigfile2" connectathon test does writes at 2G and 4G offsets in a file.
> When running this test against a windows server, this is timing out
> after 45s and throwing a -EAGAIN error back to userspace.
>
> The following patch "fixes" it, but I'm not entirely thrilled with it.
> It would be nice to detect that we are writing past the EOF and only
> increase the timeout in that situation. The problem is that by the time
> we're writing back pages i_size has already been updated.
>
> Signed-off-by: Jeff Layton <jlayton at redhat.com>
> ---
>  fs/cifs/file.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> index 81747ac..e86e7b5 100644
> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -1532,7 +1532,7 @@ retry:
>                                                   open_file->netfid,
>                                                   bytes_to_write, offset,
>                                                   &bytes_written, iov, n_iov,
> -                                                  CIFS_LONG_OP);
> +                                                  CIFS_VLONG_OP);
>                                atomic_dec(&open_file->wrtPending);
>                                if (rc || bytes_written < bytes_to_write) {
>                                        cERROR(1, ("Write2 ret %d, wrote %d",
> --
> 1.5.5.6
>
>



-- 
Thanks,

Steve


More information about the linux-cifs-client mailing list