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

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 15 Jan 2021 17:39:02 +0000

Your bug report

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

which was filed against the parted package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
45887: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=45887
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#45887: buffer cache flushed after excute 'parted -s print' command
From: "Brian C. Lane" <[email-masked]>
To: [email-masked]
Date: Fri, 15 Jan 2021 09:37:59 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

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

Subject: buffer cache flushed after excute 'parted -s print' command
From: Hyun Ha <[email-masked]>
To: [email-masked]
Date: Fri, 15 Jan 2021 12:32:42 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

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.