Duplicates in /proc/partitions
Lavrentiev, Anton (NIH/NLM/NCBI) [C]
lavr@ncbi.nlm.nih.gov
Thu Aug 19 15:15:26 GMT 2021
> > loop is not working atomically. If a new object is inserted into the
> > dir preceeding the currently handled entry (which, on a reliable system
> > should *never* occur), the entry is moved by one, and the next
> > NtQueryDirectoryObject call returns the same object again.
Very interesting... What would be inserted in the directory on my machine,
in between the calls in that original test program? It was the only one
running there, explicitly, I mean... And exclusion of the loop of partition
enumeration seemed to cancel the insertion? I think the insertion is only
one exhibition of the problem, and the other one on my machine here is
different, and not well understood, but with the same side effect,
unfortunately.
> Anyway, would you mind to test the below new proc_partition.c as well
Looks promising indeed! No duplicates:
$ ./proc_partition
bytes_read = 34346, context = 461, status = 0x00000000
major minor #blocks name win-mounts
8 0 500107608 sda (461, Harddisk0)
8 1 102400 sda1
8 2 488280064 sda2 C:\
8 16 1000204632 sdb (461, Harddisk1)
8 17 1000202240 sdb1 D:\
8 32 1000204632 sdc (461, Harddisk2)
8 33 1000202240 sdc1 G:\
8 48 1000204632 sdd (461, Harddisk3)
8 49 1000202240 sdd1 I:\
8 64 234431064 sde (461, Harddisk4)
8 65 234428416 sde1 F:\
DeviceIoControl (Harddisk5\Partition0, IOCTL_DISK_GET_PARTITION_INFO{_EX}) 5 8 80 0 sdf (461, Harddisk5)
> as the latest snapshot I just uploaded to https://cygwin.com/snapshots/?
I'll have to do that later, not now. But I'll report once I have a change to try it out.
Thanks!
Anton Lavrentiev
Contractor NIH/NLM/NCBI
More information about the Cygwin
mailing list