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

From: Hyun Ha <[email-masked]>
Date: Fri, 15 Jan 2021 12:32:42 +0900

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
              total        used        free      shared  buff/cache
available
Mem:      131463788    27276308    74617372        3064    29570108
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:
              total        used        free      shared  buff/cache
available
Mem:      131463788    27276784    75484216        3064    28702788
102167836
Swap:       4194300           0     4194300

$ free ; parted /dev/nvme0n1p11 -s print;free
              total        used        free      shared  buff/cache
available
Mem:      131463788    27324028    75436544        3128    28703216
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:
              total        used        free      shared  buff/cache
available
Mem:      131463788    27321968    76610612        3128    27531208
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.