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-----
On 12/29/2011 12:06 PM, Maxim Patlasov wrote:
> 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
> 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/
-----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/