Whamcloud - gitweb
LU-12687 osc: consume grants for direct I/O 86/39386/11
authorVladimir Saveliev <c17830@cray.com>
Mon, 29 Jun 2020 11:26:57 +0000 (14:26 +0300)
committerOleg Drokin <green@whamcloud.com>
Tue, 15 Sep 2020 05:09:29 +0000 (05:09 +0000)
commitab95f0c361a1e0e65ac51fe15ada4cb1e7eeaa1e
treec1e288e7dc839ac2b6d8739888c02ba9395b8a06
parentba702c79fbf81da830e0ba3d79f1f4efd9d50310
LU-12687 osc: consume grants for direct I/O

New IO engine implementation lost consuming grants by direct I/O
writes. That led to early emergence of out of space condition during
direct I/O. The below illustrates the problem:
  # OSTSIZE=100000 sh llmount.sh
  # dd if=/dev/zero of=/mnt/lustre/file bs=4k count=100 oflag=direct
  dd: error writing ‘/mnt/lustre/file’: No space left on device

Consume grants for direct I/O.

Try to consume grants in osc_queue_sync_pages() when it is called for
pages which are being writted in direct i/o.

Tests are added to verify grant consumption in buffered and direct i/o
and to verify direct i/o overwrite when ost is full.
The overwrite test is for ldiskfs only as zfs is unable to overwrite
when it is full.

Lustre-change: https://review.whamcloud.com/35896
Lustre-commit: 05f326a7988a7a0d6954d1b0d318315526209ae6

Fixes: 9fe4b52ad2 ("LU-1030 osc: new IO engine implementation")
Signed-off-by: Vladimir Saveliev <c17830@cray.com>
Change-Id: I9a199452c564e8e8ad02f79231e8481166f3666e
Cray-bug-id: LUS-7036
Reviewed-on: https://review.whamcloud.com/39386
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/obd_support.h
lustre/osc/osc_cache.c
lustre/osc/osc_io.c
lustre/target/tgt_grant.c
lustre/tests/conf-sanity.sh
lustre/tests/sanity.sh