From 66f8b3814cf8ca78c59d8df24cfb3cbdec5dc40d Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 10 Apr 2020 11:15:24 -0700 Subject: [PATCH] scoutfs: remove warning on reading while staging An incorrect warning condition was added as fallocate was implemented. It tried to warn against trying to read from the staging ioctl. But the staging boolean is set on the inode when the staging ioctl has the inode mutex. It protects against writes, but page reading doesn't use the mutex. It's perfectly acceptable for reads to be attempted while the staging ioctl is busy. We rely on it for a large read to consume staging being written. The warning caused reads to fail while the stager ioctl was working. Typically this would hit read-ahead and just force sync reads. But it could hit sync reads and cause EIO. Signed-off-by: Zach Brown --- kmod/src/data.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kmod/src/data.c b/kmod/src/data.c index f909d0f1..39f368ce 100644 --- a/kmod/src/data.c +++ b/kmod/src/data.c @@ -1017,8 +1017,7 @@ static int scoutfs_get_block(struct inode *inode, sector_t iblock, /* make sure caller holds a cluster lock */ lock = scoutfs_per_task_get(&si->pt_data_lock); - if (WARN_ON_ONCE(!lock) || - WARN_ON_ONCE(!create && si->staging)) { + if (WARN_ON_ONCE(!lock)) { ret = -EINVAL; goto out; }