Re: [PATCH 1/2] Add partition resize function to BLKPG ioctl

From: Phillip Susi
Date: Thu Dec 29 2011 - 19:09:31 EST


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/29/2011 12:06 PM, Maxim Patlasov wrote:
> Phillip,
>
> The patch seems to have some problems:
>
> 1. Typo in part_nr_sects_write_begin:
>
>> + write_seqcount_begin(&seq);
>
> It should be write_seqcount_begin(seq). Similar issue in
> part_nr_sects_write_end().
>
> 2. part_nr_sects_write_begin/end is never called.
>
> 3. part->seq should be initialized with seqcount_init().
>
> Btw, do we really need both part_nr_sects_write_begin and
> part_nr_sects_write_end? What about:

Good points. I also noticed that the read/write functions were only being called when not holding the mutex. If anyone is touching nr_sects without the mutex, then everyone must use the read/write functions, whether they hold the mutex or not. Otherwise, a mutex holder that touches it directly will race with a non mutex holder using the seqcounter. Vivek, rather than fix the rest of the references to nr_sects to use the read/write functions, why not just fix the few sites that were accessing it without the mutex to take the mutex fist instead of using a seqcounter?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJO/QEtAAoJEJrBOlT6nu756LYH/jPZrhv9svf9TX0orH0eZJSY
UmF3UYffWOexarz5Xppb42so+LedZLtJ5Ya7oQvcWQ5UuSRW6LNLH3tOoutmRVp5
6q5ReaEAp61neE7D2dkqJ9XjSBz7v+I/+CfNMRKhkVNq1n41UpV3iw4qYFBR3DR7
BSyfNPJlXXNU2tSJi1hT/ZsEM1/9bHKiB3yeoipln7CvRjNFjSBVyiDIFX/xl5wD
QlLKFesgxSGkYCVfdYtkdT4XybDydUIKWzVXIllFvZgqrBNnLEvwOWlhiCV93YJe
jYKHk2oWt7pSxxn3Vz8WlUbf5Jt1k/oresb6I7oVtR8c5Xutmk/HsLOT8K43YlM=
=TIs3
-----END PGP SIGNATURE-----
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/