Whamcloud - gitweb
LU-12515 ofd: allow setting a target to readonly 04/56304/10
authorRonnie Sahlberg <rsahlberg@whamcloud.com>
Fri, 6 Sep 2024 04:29:30 +0000 (00:29 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 2 Dec 2024 05:49:29 +0000 (05:49 +0000)
commit3483556684a435e71aa69f5d8575ce5e9b437bb7
treed6b8b8f87dd8e4e519f6b1b85d6c97a644d6634a
parent1a6ae4b3ebf0b1bf2625bc88b84658d2dc082321
LU-12515 ofd: allow setting a target to readonly

Add a control to toggle read-only mode for an OFD
to have it reject all mutating commands with -EROFS

This can be used to temporarily set a device to readonly mode
while identifying and correcting a misbehaving client.
As this prevents clients from destaging data it should not
be kept in readonly mode for too long else clients will
eventually run out of kernel memory.

Example:
   lctl set_param obdfilter.lustre-OST0000.readonly=1

Test-Parameters: trivial
Signed-off-by: Ronnie Sahlberg <rsahlberg@whamcloud.com>
Change-Id: Ia6658fb58aea17624d5c2ef2528696c4355e7b05
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56304
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ofd/lproc_ofd.c
lustre/ofd/ofd_internal.h
lustre/ofd/ofd_trans.c
lustre/tests/sanity.sh