bug#45887:

2021-01-18 Thread Hyun Ha
Thanks a lot for reply.

I think it make sense calling fsync when parted is done with device.
but I'm confusing because buffer cache was flushed with 'print' command in
parted also.

I think 'parted [device partitoin] -s print'  is just for getting
information about device, not for making any changes to device.

Is this also normal?


bug#45887: buffer cache flushed after excute 'parted -s print' command

2021-01-15 Thread Brian C. Lane
On Fri, Jan 15, 2021 at 12:32:42PM +0900, Hyun Ha wrote:
> Hi,
> I have a strange issue with parted.
> After execute parted command, buffer cache flushed and I don't know why.
> I have nvme device to set bcache and HDD device for backing block device of
> bcache and writeback mode.

Yes, parted calls fsync when it is done with the device. It always opens
the device in RW mode and always fsync's it when closing it to make sure
any changes make it to disk.

Brian

-- 
Brian C. Lane (PST8PDT) - weldr.io - lorax - parted - pykickstart






bug#45887: buffer cache flushed after excute 'parted -s print' command

2021-01-15 Thread Hyun Ha
Hi,
I have a strange issue with parted.
After execute parted command, buffer cache flushed and I don't know why.
I have nvme device to set bcache and HDD device for backing block device of
bcache and writeback mode.

System informations:
 - OS: CentOS Linux release 7.4.1708 (Core)
 - Kernel version: 4.18.16-1.el7.elrepo.x86_64
 - parted version: parted (GNU parted) 3.1

Reproduce:
 - create nvme partition
 - make bcache
 - execute parted command

Test:
$ free ; parted /dev/nvme0n1p10 -s print;free
  totalusedfree  shared  buff/cache
available
Mem:  1314637882727630874617372306429570108
102167828
Swap:   4194300   0 4194300
Error: /dev/nvme0n1p10: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/nvme0n1p10: 50.0GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
  totalusedfree  shared  buff/cache
available
Mem:  1314637882727678475484216306428702788
102167836
Swap:   4194300   0 4194300

$ free ; parted /dev/nvme0n1p11 -s print;free
  totalusedfree  shared  buff/cache
available
Mem:  1314637882732402875436544312828703216
102119460
Swap:   4194300   0 4194300
Error: /dev/nvme0n1p11: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/nvme0n1p11: 50.0GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
  totalusedfree  shared  buff/cache
available
Mem:  1314637882732196876610612312827531208
102121764
Swap:   4194300   0 4194300

gdisk and fdisk does not flush buffer cache with execute command.
Is this a bug or normal?
thank you in advance.