From 3613af3e15cbc6091e3a16c8caeb1307be2d91f6 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Tue, 2 Oct 2018 15:52:28 -0600 Subject: [PATCH] LU-10885 llite: enable flock mount option by default The "flock" mount option has been optional for many years, initially because of potential stability issues, and also to provide a choice for administrators to select between "flock" and "localflock" options. However, from the large number of problems that users report when trying to use applications that depend on this feature (typically databases and other cloud stacks) that disabling flock by default causes more problems than it solves. Enable the "flock" (distributed coherent userspace locking) feature by default. If applications do not need this functionality, then it will not affect them. If applications *do* need this functionality, they will get it. If administrators really know what they are doing, then they can use the "localflock" feature to enable client-local flock functionality, possibly only on select nodes that need this. Users wanting to disable this functionality should mount with the existing "-o noflock" mount option, or build the client with the "configure --disable-flock" option. If clients are already using "-o {flock|localflock|noflock}" then their existing options will be handled appropriately. Signed-off-by: Andreas Dilger Change-Id: I182637604fa22573b1da6b6b86d8915e3c3ebbe5 Reviewed-on: https://review.whamcloud.com/32091 Reviewed-by: Patrick Farrell Reviewed-by: Ben Evans Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/autoconf/lustre-core.m4 | 17 +++++++++++++++++ lustre/llite/llite_lib.c | 3 +++ 2 files changed, 20 insertions(+) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 257058f..999fb28 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -123,6 +123,22 @@ AS_IF([test "x$enable_checksum" != xno], ]) # LC_CONFIG_CHECKSUM # +# LC_CONFIG_FLOCK +# +# enable distributed flock by default +# +AC_DEFUN([LC_CONFIG_FLOCK], [ +AC_MSG_CHECKING([whether to enable flock by default]) +AC_ARG_ENABLE([flock], + AC_HELP_STRING([--disable-flock], + [disable flock by default]), + [], [enable_flock="yes"]) +AC_MSG_RESULT([$enable_flock]) +AS_IF([test "x$enable_flock" != xno], + [AC_DEFINE(ENABLE_FLOCK, 1, [enable flock by default])]) +]) # LC_CONFIG_FLOCK + +# # LC_CONFIG_HEALTH_CHECK_WRITE # # Turn off the actual write to the disk @@ -3012,6 +3028,7 @@ AC_DEFUN([LC_PROG_LINUX], [ LC_CONFIG_PINGER LC_CONFIG_CHECKSUM + LC_CONFIG_FLOCK LC_CONFIG_HEALTH_CHECK_WRITE LC_CONFIG_LRU_RESIZE diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index b4cbe57..8dcabf6 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -109,6 +109,9 @@ static struct ll_sb_info *ll_init_sbi(void) #ifdef ENABLE_CHECKSUM sbi->ll_flags |= LL_SBI_CHECKSUM; #endif +#ifdef ENABLE_FLOCK + sbi->ll_flags |= LL_SBI_FLOCK; +#endif #ifdef HAVE_LRU_RESIZE_SUPPORT sbi->ll_flags |= LL_SBI_LRU_RESIZE; -- 1.8.3.1