Whamcloud - gitweb
LU-12687 osc: consume grants for direct I/O 96/35896/26
authorVladimir Saveliev <c17830@cray.com>
Mon, 29 Jun 2020 11:26:57 +0000 (14:26 +0300)
committerOleg Drokin <green@whamcloud.com>
Fri, 10 Jul 2020 16:52:16 +0000 (16:52 +0000)
commit05f326a7988a7a0d6954d1b0d318315526209ae6
treed5ce7910067f40e92f44b728b057170dfb15f492
parenta2e38010077df3d95c9942d4f9cde829f75e7267
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.

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/35896
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
lustre/include/obd_support.h
lustre/osc/osc_cache.c
lustre/target/tgt_grant.c
lustre/tests/conf-sanity.sh
lustre/tests/sanity.sh