On Mon, Feb 6, 2017 at 1:32 PM, zhangyi (F) <yi.zhang@xxxxxxxxxx> wrote: > Hi: > We found that we cannot read the latest data from an opened file(eg: "testfile") in overlayfs > which was opened in read-only mode(this file was originally located in the lowerdir and > mapped in the mergedir, and then was copied to upperdir when someone added some data later). > > For example: > > lower: testfile(empty) > upper: empty > work: empty > merge: empty > > mount -t overlay -o lowerdir=lower,upperdir=upper,workdir=work overlayfs merge > > 1) fd1 = open("merge/testfile", O_RDONLY); > 2) fd2 = open("merge/testfile", O_WRONLY | O_APPEND); > then we write some new data to fd2. > 3) read data form fd1. > > expect results: we read data which was written used by fd2. > reality results: nothing. > > We cannot read data from the copied file in the upperdir use fd1, so do we need to fix it? This is a documented quirk (see section "Non-standard behavior" in Documentation/filesystems/overlayfs.txt). Hopefully will have a fix in a future version. Thanks, Miklos > > Thanks, > zhangyi > > -- > 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 -- 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