[Drbd-dev] [PATCH] block: read i_size with i_size_read()

Lars Ellenberg lars.ellenberg at linbit.com
Fri Nov 5 22:04:54 CET 2010


On Fri, Nov 05, 2010 at 03:27:21PM -0400, Mike Snitzer wrote:
> Convert direct reads of an inode's i_size to using i_size_read().
> 
> i_size_{read,write} use a seqcount to protect reads from accessing
> incomple writes.  Concurrent i_size_write()s require mutual exclussion
> to protect the seqcount that is used by i_size_{read,write}.  But
> i_size_read() callers do not need to use additional locking.
> 
> Signed-off-by: Mike Snitzer <snitzer at redhat.com>
> Cc: Jens Axboe <jaxboe at fusionio.com>
> Cc: Neil Brown <neilb at suse.de>
> Cc: drbd-dev at lists.linbit.com
> ---
>  block/blk-core.c              |    4 ++--
>  block/compat_ioctl.c          |    4 ++--
>  block/ioctl.c                 |    6 +++---
>  drivers/block/drbd/drbd_int.h |    2 +-
>  drivers/md/md.c               |   18 +++++++++---------
>  5 files changed, 17 insertions(+), 17 deletions(-)

DRBD one line fix trivially
  Acked-by: Lars Ellenberg <lars.ellenberg at linbit.com>


> NOTE: I stopped short of fixing drbd and nbd to use revalidate_disk
> and/or i_size_write.

Ok, we'll pick up the DRBD part of it.

-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.


More information about the drbd-dev mailing list