RE: [PATCH 2/4] imsm: FIX: spare cannot be added

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Neil Brown [mailto:neilb@xxxxxxx]
> Sent: Thursday, January 27, 2011 4:03 AM
> To: Kwolek, Adam
> Cc: linux-raid@xxxxxxxxxxxxxxx; Williams, Dan J; Ciechanowski, Ed;
> Neubauer, Wojciech
> Subject: Re: [PATCH 2/4] imsm: FIX: spare cannot be added
> 
> On Thu, 20 Jan 2011 11:57:30 +0100
> Adam Kwolek <adam.kwolek@xxxxxxxxx> wrote:
> 
> > When Manage.c adds spare, it calls write_init_super() and this
> > function is responsible for closing disk handle (Manage.c:812).
> > For imsm case this handle is reused for managing this disk and handle
> > (due to this it is not closed).
> > As handle was opened with flag O_EXCL, adding disk to md fails on
> > writing to new_dev (md cannot set lock on device).
> > To resolve situation close current handle and open new one without
> > O_EXCL flag.
> 
> Thanks.
> I have created a different solution. write_init_super doesn't close
> anything any more.
> Hopefully the new approach works better.
> 
> Thanks,
> NeilBrown

I found the same issue in ne code yesterday, so I've resent this patch (reminder for myself ;))
I'll have a closer look on this problem next week.

BR
Adam

> >
> > Signed-off-by: Anna Czarnowska <anna.czarnowska@xxxxxxxxx>
> > Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx>
> > ---
> >
> >  super-intel.c |    9 +++++++++
> >  1 files changed, 9 insertions(+), 0 deletions(-)
> >
> > diff --git a/super-intel.c b/super-intel.c
> > index 7f907ef..0d6d2ee 100644
> > --- a/super-intel.c
> > +++ b/super-intel.c
> > @@ -3714,6 +3714,7 @@ static int mgmt_disk(struct supertype *st)
> >  	struct intel_super *super = st->sb;
> >  	size_t len;
> >  	struct imsm_update_add_remove_disk *u;
> > +	struct dl *d;
> >
> >  	if (!super->disk_mgmt_list)
> >  		return 0;
> > @@ -3729,6 +3730,14 @@ static int mgmt_disk(struct supertype *st)
> >  	u->type = update_add_remove_disk;
> >  	append_metadata_update(st, u, len);
> >
> > +	for (d = super->disk_mgmt_list; d ; d = d->next) {
> > +		char buf[PATH_MAX];
> > +
> > +		close(d->fd);
> > +		sprintf(buf, "%d:%d", d->major, d->minor);
> > +		d->fd = dev_open(buf, O_RDWR | O_DIRECT);
> > +	}
> > +
> >  	return 0;
> >  }
> >

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux