Whamcloud - gitweb
LU-10681: Disable tiny writes for append 53/31353/8
authorPatrick Farrell <paf@cray.com>
Sat, 3 Mar 2018 22:59:43 +0000 (16:59 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 8 Mar 2018 17:35:47 +0000 (17:35 +0000)
commitd79ffa3ff7461d8dcfb831f0024ed093a3f6f104
tree0cdbe870285f3002a51499fa944edf54de1ef349
parenteb65c3a586f1efd425f8360972b5d365cfecf7e1
LU-10681: Disable tiny writes for append

Unfortunately, tiny writes do not work correctly with
appending to files.  When appending to a file, we must take
DLM locks to EOF on all stripes, in order to protect file
size so we can append correctly.

If we dirty a page with a normal write then append to it
with a tiny write, these DLM locks are not present, and we
can use an incorrect size if another client writes to a
different stripe, increasing the size without cancelling
the lock which is protecting our dirty page.

We could theoretically check to make sure the required DLM
locks are held, but this would be time consuming.

The simplest solution is to just not allow tiny writes when
appending.

Also add option to disable tiny writes at runtime.

Cray-bug-id: LUS-5723

Change-Id: Ic9421faa3d0268d907040881e8ba3c894261fd49
Signed-off-by: Patrick Farrell <paf@cray.com>
Reviewed-on: https://review.whamcloud.com/31353
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/lproc_llite.c
lustre/tests/sanityn.sh