From a883524389b595105e6d02bb4b8fbd4c24d4342d Mon Sep 17 00:00:00 2001 From: Erez_Zadok Date: Mon, 26 Nov 2007 19:54:54 -0500 Subject: [PATCH] Unionfs: cache-coherency fixes Do not update mtime if there is no upper branch for the inode. This prevents from calling unionfs_lower_inode_idx() with a negative index, which triggers a bug. Signed-off-by: Olivier Blin Acked-by: Erez Zadok --- fs/unionfs/fanout.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/unionfs/fanout.h b/fs/unionfs/fanout.h index e952f385404..2691ec0c5d3 100644 --- a/fs/unionfs/fanout.h +++ b/fs/unionfs/fanout.h @@ -309,7 +309,7 @@ static inline void unionfs_copy_attr_times(struct inode *upper) int bindex; struct inode *lower; - if (!upper) + if (!upper || ibstart(upper) < 0) return; for (bindex=ibstart(upper); bindex <= ibend(upper); bindex++) { lower = unionfs_lower_inode_idx(upper, bindex); -- 2.43.0