[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: malformed i-node-names at "TRANSPORT" directory ...

Matti Aarnio <mea@nic.funet.fi>
>   However I don't know any LOCAL filesystems which exhibit this behaviour,
>   and I do believe that even NFS is sane in this regard.
>   Any other possibilities ? Anyone ?

Well, if the goal is to use rename(), and deal with its theoretical
lack of inode number preservatio, then this bit should provide the

    char c[PATH_MAX];
    statbuf st;

    rename( a, b );
    stat( st, b );
    sprintf( c, "..../%d", st.st_inode );
    if ( strcmp( b, c ) != 0 ) {
	link( b, c );
	unlink( b );

rename() and stat() can go wrong IRC, of course, and need result
checking.  The link()/unlink() pair aren't ever going to be tested,
I'd guess, so keep it simple.

(Do I even understand the problem correctly?)