Whamcloud - gitweb
LU-11811 mdt: Add a proc entry to set MDT to readonly 92/33892/3
authorJinshan Xiong <jinshan.xiong@uber.com>
Tue, 18 Dec 2018 23:36:33 +0000 (15:36 -0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 11 Feb 2019 03:21:35 +0000 (03:21 +0000)
commit23bae7dc21b5c955c096431d485e49a7298ec404
treea0398917eece5f46fc019386a706ec4b593cce85
parent82d014e71e14671e876055851a0d37e98b4cc079
LU-11811 mdt: Add a proc entry to set MDT to readonly

It is sometimes desirable to be able to mark the filesystem read-only
directly on the server, rather than remounting the clients and setting
the option there.  This can be useful if there is a rogue client
that is deleting files, or when decommissioning a system to
prevent already-mounted clients from modifying it anymore.

Add the mdt.*.readonly parameter to allow setting the MDT read-only
immediately if set to 1.  All future MDT access will immediately
return -EROFS until the parameter is set to 0 again.

Signed-off-by: Jinshan Xiong <jinshan.xiong@uber.com>
Change-Id: I6d8d529ed4ba797012ded6920a9d9e7db6659efc
Reviewed-on: https://review.whamcloud.com/33892
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_lproc.c
lustre/tests/sanity.sh