Re: [PATCH] netfs: Fix i_size updating

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Howells <dhowells@xxxxxxxxxx> writes:

> Fix the updating of i_size, particularly in regard to the completion of DIO
> writes and especially async DIO writes by using a lock.
>
> The bug is triggered occasionally by the generic/207 xfstest as it chucks a
> bunch of AIO DIO writes at the filesystem and then checks that fstat()
> returns a reasonable st_size as each completes.
>
> The problem is that netfs is trying to do "if new_size > inode->i_size,
> update inode->i_size" sort of thing but without a lock around it.
>
> This can be seen with cifs, but shouldn't be seen with kafs because kafs
> serialises modification ops on the client whereas cifs sends the requests
> to the server as they're generated and lets the server order them.
>
> Fixes: 153a9961b551 ("netfs: Implement unbuffered/DIO write support")
> Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
> cc: Steve French <sfrench@xxxxxxxxx>
> cc: Paulo Alcantara <pc@xxxxxxxxxxxxx>
> cc: linux-cifs@xxxxxxxxxxxxxxx
> cc: netfs@xxxxxxxxxxxxxxx
> cc: linux-fsdevel@xxxxxxxxxxxxxxx
> ---
>  fs/netfs/buffered_write.c |    2 ++
>  fs/netfs/direct_write.c   |    8 ++++++--
>  2 files changed, 8 insertions(+), 2 deletions(-)

Reviewed-by: Paulo Alcantara (Red Hat) <pc@xxxxxxxxxxxxx>




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux