Skip to content
Commit 65af8f01 authored by Steve French's avatar Steve French
Browse files

cifs: fix allocation size on newly created files



Applications that create and extend and write to a file do not
expect to see 0 allocation size.  When file is extended,
set its allocation size to a plausible value until we have a
chance to query the server for it.  When the file is cached
this will prevent showing an impossible number of allocated
blocks (like 0).  This fixes e.g. xfstests 614 which does

    1) create a file and set its size to 64K
    2) mmap write 64K to the file
    3) stat -c %b for the file (to query the number of allocated blocks)

It was failing because we returned 0 blocks.  Even though we would
return the correct cached file size, we returned an impossible
allocation size.

Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
CC: <stable@vger.kernel.org>
Reviewed-by: default avatarAurelien Aptel <aaptel@suse.com>
parent af3ef3b1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment