Tomas M: > #!/bin/bash > mkdir dir1 > touch dir1/something > mkdir union > mount.posixovl dir1 > mount -t aufs -o br:dir1=rw aufs union
I guess you can succeed if you use dir1 directly without mount.posixovl. > If we run 'mount.posixovl' with -d parameter (debug), we can see that > nothing access the mounted directory dir1 at all during the aufs mount, > GETATTR is not called, so it seems aufs can not know nlink properly. Getattr is totally different from lookup. Every filesystem should return correct inode as a result of lookup (when the target file exists). You should not confuse lookup with getattr. If you want to change the value of nlink, I guess what you should override is lookup instead of getattr. Why don't you use fuse_lowlevel_ops.lookup instead of fuse_operations? > If we stat the dir1 and after then we mount aufs, it's OK. If customizing lookup is hard for you, to issue stat(2) before using posixovl as an aufs branch is the best solution. > Jan suggests the following: > > > Try replacing aufs/opts.c, > > near line 422: > > err = path_lookup(add->path, lkup_dirflags, &add->nd); > > use "lkup_dirflags | LOOKUP_REVAL". (One would have to add it to > > more places like branch deletion) > > > Would you please consider Jan's suggestion? Do you mean LOOKUP_REVAL calls fuse getattr? I don't think it is correct. Did you try it actually by yourself? Junjiro Okajima ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/