FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 03-19-2012, 01:00 PM
Alasdair G Kergon
 
Default dm_thin: commit just before processing a pool target info request

On Fri, Mar 16, 2012 at 03:22:36PM +0000, Joe Thornber wrote:
> This makes the free block counts more accurate.

I'm not keen on this one: deferring it.

> --- a/drivers/md/dm-thin.c
> +++ b/drivers/md/dm-thin.c
> @@ -2305,6 +2305,15 @@ static int pool_status(struct dm_target *ti, status_type_t type,

(Used by dmsetup status and wait.)

> + /*
> + * If we're in the middle of a transaction the free block
> + * counts can be quite out of date, so we do a quick
> + * commit.
> + */
> + r = dm_pool_commit_metadata(pool->pmd);
> + if (r)
> + return r;
> +

1) If commit fails (repeatedly?) we still need to get the status.

2) Could the commit ever be too slow? (Or re-use NOFLUSH flag to skip it?)

Alasdair

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 03-20-2012, 09:12 AM
Joe Thornber
 
Default dm_thin: commit just before processing a pool target info request

On Mon, Mar 19, 2012 at 02:00:12PM +0000, Alasdair G Kergon wrote:
> On Fri, Mar 16, 2012 at 03:22:36PM +0000, Joe Thornber wrote:
> > This makes the free block counts more accurate.
>
> I'm not keen on this one: deferring it.
>
> > --- a/drivers/md/dm-thin.c
> > +++ b/drivers/md/dm-thin.c
> > @@ -2305,6 +2305,15 @@ static int pool_status(struct dm_target *ti, status_type_t type,
>
> (Used by dmsetup status and wait.)
>
> > + /*
> > + * If we're in the middle of a transaction the free block
> > + * counts can be quite out of date, so we do a quick
> > + * commit.
> > + */
> > + r = dm_pool_commit_metadata(pool->pmd);
> > + if (r)
> > + return r;
> > +
>
> 1) If commit fails (repeatedly?) we still need to get the status.
>
> 2) Could the commit ever be too slow? (Or re-use NOFLUSH flag to skip it?)

Agreed. The correct solution is to switch to a read-only mode if the
commit fails, and thus never commit again. Commit does some io
obviously; not sure what constitutes 'too slow'.

- Joe

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 02:42 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org