@@ -4275,6 +4275,18 @@ int ll_migrate(struct inode *parent, struct file *file, struct lmv_user_md *lum,
static int
ll_file_noflock(struct file *file, int cmd, struct file_lock *file_lock)
{
+ struct ll_file_data *fd = LUSTRE_FPRIVATE(file);
+
+ /*
+ * In order to avoid flood of warning messages, only print one message
+ * for one file. And the entire message rate on the client is limited
+ * by CDEBUG_LIMIT too.
+ */
+ if (!(fd->fd_flags & LL_FILE_FLOCK_WARNING)) {
+ fd->fd_flags |= LL_FILE_FLOCK_WARNING;
+ CDEBUG_LIMIT(D_TTY | D_CONSOLE,
+ "flock disabled, mount with '-o [local]flock' to enable\r\n");
+ }
return -EINVAL;
}
@@ -106,7 +106,7 @@ struct ptldebug_header {
#define D_TRACE 0x00000001 /* ENTRY/EXIT markers */
#define D_INODE 0x00000002
#define D_SUPER 0x00000004
-#define D_EXT2 0x00000008 /* anything from ext2_debug */
+#define D_TTY 0x00000008 /* notification printed to TTY */
#define D_MALLOC 0x00000010 /* print malloc, free information */
#define D_CACHE 0x00000020 /* cache-related items */
#define D_INFO 0x00000040 /* general information */
@@ -137,7 +137,7 @@ struct ptldebug_header {
#define D_LAYOUT 0x80000000
#define LIBCFS_DEBUG_MASKS_NAMES { \
- "trace", "inode", "super", "ext2", "malloc", "cache", "info", \
+ "trace", "inode", "super", "tty", "malloc", "cache", "info", \
"ioctl", "neterror", "net", "warning", "buffs", "other", \
"dentry", "nettrace", "page", "dlmtrace", "error", "emerg", \
"ha", "rpctrace", "vfstrace", "reada", "mmap", "config", \
@@ -385,7 +385,7 @@ struct ll_ioc_lease_id {
#define LL_FILE_READAHEA 0x00000004
#define LL_FILE_LOCKED_DIRECTIO 0x00000008 /* client-side locks with dio */
#define LL_FILE_LOCKLESS_IO 0x00000010 /* server-side locks with cio */
-#define LL_FILE_RMTACL 0x00000020
+#define LL_FILE_FLOCK_WARNING 0x00000020 /* warned about disabled flock */
#define LOV_USER_MAGIC_V1 0x0BD10BD0
#define LOV_USER_MAGIC LOV_USER_MAGIC_V1