From 253d6bfa55b27918aed6359ecdd9c68a621a5502 Mon Sep 17 00:00:00 2001 From: Chameleon Cloud User Date: Mon, 13 Dec 2021 07:28:59 +0000 Subject: [PATCH] Flushing edge cachelines properly when write is not aligned --- Linux-5.1/fs/winefs/xip.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Linux-5.1/fs/winefs/xip.c b/Linux-5.1/fs/winefs/xip.c index b72743f6b..2de5aa5bc 100644 --- a/Linux-5.1/fs/winefs/xip.c +++ b/Linux-5.1/fs/winefs/xip.c @@ -178,8 +178,7 @@ static inline void pmfs_flush_edge_cachelines(loff_t pos, ssize_t len, { if (unlikely(pos & 0x7)) pmfs_flush_buffer(start_addr, 1, false); - if (unlikely(((pos + len) & 0x7) && ((pos & (CACHELINE_SIZE - 1)) != - ((pos + len) & (CACHELINE_SIZE - 1))))) + if (unlikely(((pos + len) & 0x7) && len > 0)) pmfs_flush_buffer(start_addr + len, 1, false); }