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

From: Maxim Patlasov
Date: Thu Dec 29 2011 - 12:06:34 EST


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:

#if BITS_PER_LONG == 32 && defined(CONFIG_LBDAF)
static inline void part_nr_sects_write(struct hd_struct *part,
sector_t nr_sects)
{
write_seqcount_begin(&part->seq);
part->nr_sects = nr_sects;
write_seqcount_end(&part->seq);
}
#else
static inline void part_nr_sects_write(struct hd_struct *part,
sector_t nr_sects)
{
part->nr_sects = nr_sects;
}
#endif

and use part_nr_sects_write(part, length) instead of part->nr_sects =
length in case BLKPG_RESIZE_PARTITION?

Thanks,
Maxim
--
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/