Re: [PATCH 1/2] loop: use filp_close() rather than fput()

From: Al Viro
Date: Fri Jun 16 2017 - 20:02:08 EST


On Fri, Jun 16, 2017 at 03:02:09PM +1000, NeilBrown wrote:
> When a loop device is being shutdown the backing file is
> closed with fput(). This is different from how close(2)
> closes files - it uses filp_close().
>
> The difference is important for filesystems which provide a ->flush
> file operation such as NFS. NFS assumes a flush will always
> be called on last close, and gets confused otherwise.

Huh? You do realize that mmap() + close() + modify + msync() + munmap()
will have IO done *after* the last flush, right?