[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <x49ob7gevz7.fsf@segfault.boston.devel.redhat.com>
Date: Wed, 25 Sep 2013 11:56:12 -0400
From: Jeff Moyer <jmoyer@...hat.com>
To: majianpeng <majianpeng@...il.com>
Cc: axboe <axboe@...nel.dk>, viro <viro@...iv.linux.org.uk>,
LKML <linux-kernel@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: [PATCH V2 1/2] block: Set inode of block_device size to zero when delete gendisk.
majianpeng <majianpeng@...il.com> writes:
> When remove gendisk, set the size of inode of block_device to zero.
> This is mainly let the vfs know disk removed.
>
> Signed-off-by: Jianpeng Ma <majianpeng@...il.com>
Reviewed-by: Jeff Moyer <jmoyer@...hat.com>
> ---
> block/genhd.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/block/genhd.c b/block/genhd.c
> index dadf42b..9a4c245 100644
> --- a/block/genhd.c
> +++ b/block/genhd.c
> @@ -1369,6 +1369,12 @@ int invalidate_partition(struct gendisk *disk, int partno)
> if (bdev) {
> fsync_bdev(bdev);
> res = __invalidate_device(bdev, true);
> + /*
> + * When used buffer-mode on raw blockdevice,the disk removed.
> + * But the vfs don't know.So tell the vfs size of disk
> + * became zero, the buffer write can return
> + */
> + i_size_write(bdev->bd_inode, 0);
> bdput(bdev);
> }
> return res;
--
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