Whamcloud - gitweb
LU-12349 llite: console message for disabled flock call 86/34986/13
authorLi Xi <lixi@ddn.com>
Thu, 13 Jun 2019 03:27:50 +0000 (11:27 +0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 28 Jun 2019 00:01:39 +0000 (00:01 +0000)
commitf6497eb3503b7efff823888ed76422db4e9e078e
treeaa777ff223d28128d8e919dc19c749bbd352af75
parentb0ce7701d1e9dd1269b99b1c660a140fe85b9592
LU-12349 llite: console message for disabled flock call

When flock option is disabled on a Lustre client, any call to
flock() or lockf() would cause a return value with failure.
For applications that don't print proper error message, it is
hard to know the root cause is the missing flock option on Lustre
file system. Thus this patch prints following error message to
the tty that calls flock()/lockf():

"Lustre: flock disabled, mount with '-o [local]flock' to enable"

Such message will print to each file descriptor no more than
once to avoid message flood.

In order to do so, this patch adds support for CDEBUG_LIMIT(D_TTY).
It prints the message to tty. When using this macro, please
note that "\r\n" needs to be the end of the line. Otherwise,
message like "format at $FILE:$LINO:$FUNC doesn't end in '\r\n'"
will be printed to the system message for warning.

Change-Id: I4eeb3ea219848ebbbca9d14e3d2b8a23237105b5
Signed-off-by: Li Xi <lixi@ddn.com>
Reviewed-on: https://review.whamcloud.com/34986
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/libcfs/debug.c
libcfs/libcfs/linux/linux-tracefile.c
libcfs/libcfs/tracefile.c
lnet/include/uapi/linux/lnet/libcfs_debug.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/llite/file.c
lustre/osd-ldiskfs/osd_io.c
lustre/utils/llanalyze