On Tue, Dec 19, 2017 at 3:48 PM, Vivek Goyal <vgoyal@xxxxxxxxxx> wrote: > On Tue, Dec 19, 2017 at 09:49:28AM +0800, Chengguang Xu wrote: >> > >> > 在 2017年12月19日,上午12:02,Vivek Goyal <vgoyal@xxxxxxxxxx> 写道: >> > >> > On Mon, Dec 18, 2017 at 08:55:48PM +0800, Chengguang Xu wrote: >> >> Inspired by encountering unexpected write error when >> >> upperdir and workdir having different project ids. >> > >> > Can you please make this problem descrition little better. By >> > these two lines I really don't understand what's the problem >> > you are trying to solve. All I understood was that upperdir >> > and workdir had different project id. But not sure what >> > problem it led to and why. >> > >> > In fact your first patch changelong was little better. It >> > atleast said that you encounter "-EXDEV". So is it rename >> > which fails. So rename is not allowed between two directories >> > having different project ids? >> > >> >> The background is >> I encountered an unexpected write error with error code -EXDEV in >> my environment which didn’t break any rules in overlayfs kernel >> document. >> >> So I did some investigations and found when upperdir and workdir >> having different project quotas then rename/link operations between >> those directories would be fail with -EXDEV because project quota >> asks files in it strictly inherit project id with it’s own. This will >> make write fail during copy-up process. >> >> I wrote first patch to check this condition, but that check seems not >> sufficient to detect write error, so after discussion with Amir, >> we decided to check link ability between upperdir and workdir, it is >> what copy-up actually doing when modifying files in lowerdirs, and also >> I decided to only print a warning message instead of directly mounting >> on read-only mode in case there is a special use case just read and do not >> modify anything in lowerdirs. > > Ok, thanks for the explanation. I really wish that some of it makes to > changelog so that somebody reading it later finds it much easier to > understand. > > BTW, just curious, when upper supports O_TMPFILE, do we have to create > tmpfile in workdir/. Can we create it in upper/ and then link in > appropriate destination directory. > Do you mean like this: d8514d8edb5b ovl: copy up regular file using O_TMPFILE > Amir, is there a fundamental requirement about why tmpfile creation has > to be in workdir. > It isn't. With indexed copy up, tmpfile is created in indexdir and linked to index dir, then linked again to upper dir. With non-indexed copy up (of regular file, when O_TMPFILE supported) tmpfile is created in upperdir and linked to upper dir, which allows for concurrent copy up of two files within different parent dirs. Amir. -- 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