lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111208162847.GB9281@redhat.com>
Date:	Thu, 8 Dec 2011 11:28:47 -0500
From:	Vivek Goyal <vgoyal@...hat.com>
To:	Phillip Susi <psusi@....rr.com>
Cc:	Karel Zak <kzak@...hat.com>, linux-kernel@...r.kernel.org,
	Jens Axboe <jaxboe@...ionio.com>
Subject: Re: [PATCH 1/2] Add partition resize function to BLKPG ioctl

On Thu, Dec 08, 2011 at 11:06:29AM -0500, Phillip Susi wrote:
> On 12/8/2011 10:58 AM, Vivek Goyal wrote:
> >So, if there is an IO in flight while partition shrinking is happening,
> >then IO can end up happening outside the partition?
> 
> Yes.  Of course if there was an in flight IO at the time you
> truncate the partition, then you did something wrong ( didn't shrink
> the fs first ).

Ok, so one needs to shrink filesystem. So if partition is part of a
volume group one is supposed to first reduce the size using pvresize
and then shrink actual partition?

> 
> >part->nr_sects can be 64 bits on 32bit machines and update will be
> >non-atomic. I had used sequence counter to make sure read is able
> >to get to intermediate value. May be it is a good idea to address
> >this concenrn.
> 
> Isn't that what the mutex is for?

I thought I have found couple of places where we don't take mutex. For
example.

drive_stat_acct()
 disk_map_sector_rcu()
  sector_in_part()
    --> read part->nr_sects without mutex.

printk_all_partitions()
   ---> read part->nr_sects without mutex.

show_partition()
   ---> read part->nr_sects without mutex.

Thanks
Vivek
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ