Hello Christopher, Wednesday, January 30, 2008, 7:27:01 AM, you wrote:
CG> Carson Gaspar wrote: >> Christopher Gorski wrote: >> >>> I noticed that the first calls in the "cp" and "ls" to getdents() return >>> similar file lists, with the same values. >>> >>> However, in the "ls", it makes a second call to getdents(): >> >> If this is Sun's cp, file a bug. It's failing to notice that it didn't >> provide a large enough buffer to getdents(), so it only got partial results. >> >> Of course, the getdents() API is rather unfortunate. It appears the only >> safe algorithm is: >> >> while ((r = getdents(...)) > 0) { >> /* process results */ >> } >> if (r < 0) { >> /* handle error */ >> } >> >> You _always_ have to call it at least twice to be sure you've gotten >> everything. >> CG> Yes, it is Sun's cp. I'm trying, with some difficulty, to figure out CG> exactly how to reproduce this error in a way not specific to my data. I CG> copied a set of randomly generated files with a deep directory structure CG> and cp seems to correctly call getdents() multiple times. If you could re-create empty files - exactly the same directory atructure and file names, check if you still got a problem. If you do, then if you could send a script here (mkdir's -p and touch) so we can investigate. Assuming your file names and directory structure can be made public. -- Best regards, Robert Milkowski mailto:[EMAIL PROTECTED] http://milek.blogspot.com _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss