[PATCH] ovl: fix inconsistent d_ino for merge dir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Current ovl_getattr() (stat(2)) return lower's d_ino for merge
directory (No any extended attribute) but ovl_iterate()
(getdents(2)) return upper's d_ino.

This patch correct inconsistent d_ino for this case, change to
return lower's d_ino in ovl_iterate() for merge dir.

Signed-off-by: zhangyi (F) <yi.zhang@xxxxxxxxxx>
---
 fs/overlayfs/readdir.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c
index 8c98578..9548712 100644
--- a/fs/overlayfs/readdir.c
+++ b/fs/overlayfs/readdir.c
@@ -136,6 +136,11 @@ static bool ovl_calc_d_ino(struct ovl_readdir_data *rdd,
 	    ovl_test_flag(OVL_IMPURE, d_inode(rdd->dentry)))
 		return true;
 
+	/* Recalc d_ino for all dir in merge dir (contains merge subdirs) */
+	if (p->type == DT_DIR &&
+	    OVL_TYPE_MERGE(ovl_path_type(rdd->dentry)))
+		return true;
+
 	return false;
 }
 
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux