[dm-devel] [PATCH 29/44] block: remove the nr_sects field in struct hd_struct

2020-11-26 Thread Christoph Hellwig
Now that the hd_struct always has a block device attached to it, there is no need for having two size field that just get out of sync. Additional the field in hd_struct did not use proper serializiation, possibly allowing for torn writes. By only using the block_device field this problem also get

Re: [dm-devel] [PATCH 29/44] block: remove the nr_sects field in struct hd_struct

2020-11-26 Thread Jan Kara
On Thu 26-11-20 14:04:07, Christoph Hellwig wrote: > Now that the hd_struct always has a block device attached to it, there is > no need for having two size field that just get out of sync. > > Additional the field in hd_struct did not use proper serializiation, ^^ Additionaly

Re: [dm-devel] [PATCH 29/44] block: remove the nr_sects field in struct hd_struct

2020-11-26 Thread Christoph Hellwig
On Thu, Nov 26, 2020 at 05:50:36PM +0100, Jan Kara wrote: > > + if (size == capacity || > > + (disk->flags & (GENHD_FL_UP | GENHD_FL_HIDDEN)) != GENHD_FL_UP) > > + return false; > > + pr_info("%s: detected capacity change from %lld to %lld\n", > > + disk->disk_name, si

Re: [dm-devel] [PATCH 29/44] block: remove the nr_sects field in struct hd_struct

2020-11-26 Thread Jan Kara
On Thu 26-11-20 18:52:08, Christoph Hellwig wrote: > On Thu, Nov 26, 2020 at 05:50:36PM +0100, Jan Kara wrote: > > > + if (size == capacity || > > > + (disk->flags & (GENHD_FL_UP | GENHD_FL_HIDDEN)) != GENHD_FL_UP) > > > + return false; > > > + pr_info("%s: detected capacity change from

Re: [dm-devel] [PATCH 29/44] block: remove the nr_sects field in struct hd_struct

2020-11-27 Thread Christoph Hellwig
On Thu, Nov 26, 2020 at 07:04:08PM +0100, Jan Kara wrote: > On Thu 26-11-20 18:52:08, Christoph Hellwig wrote: > > On Thu, Nov 26, 2020 at 05:50:36PM +0100, Jan Kara wrote: > > > > + if (size == capacity || > > > > + (disk->flags & (GENHD_FL_UP | GENHD_FL_HIDDEN)) != > > > > GENHD_