From 886ee4dfacdbdff68f7cf5d4938fdf1c81b98e03 Mon Sep 17 00:00:00 2001 From: Xavi Hernandez Date: Fri, 6 Jul 2018 23:26:41 +0200 Subject: posix: Do not log ENXIO errors for seek fop When lseek is used with SEEK_DATA and SEEK_HOLE, it's expected that the last operation fails with ENXIO when offset is beyond the end of file. In this case it doesn't make sense to report this as an error log message. This patch reports ENXIO failure messages for seek fops in debug level instead of error level. Change-Id: I62a4f61f99b0e4d7ea6a2cdcd40afe15072794ac fixes: bz#1598926 Signed-off-by: Xavi Hernandez --- libglusterfs/src/common-utils.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 66a78e9f7cb..60725769096 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -4352,6 +4352,12 @@ fop_log_level (glusterfs_fop_t fop, int op_errno) if (op_errno == EEXIST) return GF_LOG_DEBUG; + if (fop == GF_FOP_SEEK) { + if (op_errno == ENXIO) { + return GF_LOG_DEBUG; + } + } + return GF_LOG_ERROR; } -- cgit