Whamcloud - gitweb
LU-2049 grant: delay grant releasing until commit 31/13531/14
authorJohann Lombardi <johann.lombardi@intel.com>
Mon, 26 Jan 2015 16:04:51 +0000 (17:04 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 14 Oct 2015 05:06:55 +0000 (05:06 +0000)
commit31b7404f436241436fb0abdec2b6cd678c674d82
tree2039c5f23021aaa07ada6d7e89acb3457e1dd2a3
parentdd16884e8e367007e792708901bdf55ffeac665b
LU-2049 grant: delay grant releasing until commit

Grant space acquired for a bulk write is released from the grant
accounting at the end of request processing. At that point, the
additional space consumed by the write request is believed to be
taken into account in any subsequent statfs call.
However, it does not seem to be the case with all backend
filesystems and more particularly ZFS which seems to provide
reliable space information only once the transaction associated
with the bulk write has committed. This creates a hole in the
grant space management where we can end up allocating more grant
space than really available.

This patch postpones grant releasing until transaction commit time.
This is done by registering a commit callback in charge of this
operation.
The patch also removes the implicit use of info->fti_used and stores
the amount of grant space to be released in obdo::o_grant_used.

Signed-off-by: Johann Lombardi <johann.lombardi@intel.com>
Change-Id: Id99b8712ffc1e5f103df4835b698127619b8ba85
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-on: http://review.whamcloud.com/13531
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_grant.c
lustre/ofd/ofd_internal.h
lustre/ofd/ofd_io.c
lustre/ofd/ofd_obd.c