All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] (2/11) various minor cleanups
@ 2008-10-30 17:52 Petr Rockai
  2008-11-05 15:54 ` Dave Wysochanski
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Rockai @ 2008-10-30 17:52 UTC (permalink / raw
  To: lvm-devel

Hi,

just un-interesting minor changes that have happened while working on lvmlib.

Yours,
   Petr.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2-lvmlib-various.diff
Type: text/x-diff
Size: 1906 bytes
Desc: lvmlib-various.diff
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20081030/2eabad38/attachment.bin>
-------------- next part --------------

-- 
Peter Rockai | me()mornfall!net | prockai()redhat!com
 http://blog.mornfall.net | http://web.mornfall.net

"In My Egotistical Opinion, most people's C programs should be
 indented six feet downward and covered with dirt."
     -- Blair P. Houghton on the subject of C program indentation

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] (2/11) various minor cleanups
  2008-10-30 17:52 [PATCH] (2/11) various minor cleanups Petr Rockai
@ 2008-11-05 15:54 ` Dave Wysochanski
  2008-11-05 16:28   ` Alasdair G Kergon
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Wysochanski @ 2008-11-05 15:54 UTC (permalink / raw
  To: lvm-devel


On Thu, 2008-10-30 at 18:52 +0100, Petr Rockai wrote:
> diff -rN -p -u old-lvmlib-b/lib/device/dev-io.c
> new-lvmlib-b/lib/device/dev-io.c
> --- old-lvmlib-b/lib/device/dev-io.c    2008-10-30 17:43:21.097833255
> +0100
> +++ new-lvmlib-b/lib/device/dev-io.c    2008-10-30 17:43:21.161836711
> +0100
> @@ -622,6 +622,11 @@ int dev_write(struct device *dev, uint64
>         where.start = offset;
>         where.size = len;
>  
> +       if (!vg_write_lock_held()) {
> +               log_error("Attempted to write unlocked VG's device.");
> +               return_0;
> +       }
> +
>         dev->flags |= DEV_ACCESSED_W;
>  
> 

This looks a little strange here but as far as I can tell this is a
reasonable check.  The only command I could think of that might write to
a device without a write VG lock would be vgcfgbackup, but this actually
uses its own IO path (not dev_write()).

Probably want a WHATS_NEW comment like:
Do not allow dev_write() to proceed unless a VG write lock is held.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] (2/11) various minor cleanups
  2008-11-05 15:54 ` Dave Wysochanski
@ 2008-11-05 16:28   ` Alasdair G Kergon
  0 siblings, 0 replies; 3+ messages in thread
From: Alasdair G Kergon @ 2008-11-05 16:28 UTC (permalink / raw
  To: lvm-devel

On Wed, Nov 05, 2008 at 10:54:24AM -0500, Dave Wysochanski wrote:
> On Thu, 2008-10-30 at 18:52 +0100, Petr Rockai wrote:
> > +               log_error("Attempted to write unlocked VG's device.");

> Probably want a WHATS_NEW comment like:
> Do not allow dev_write() to proceed unless a VG write lock is held.
 
And make the error message useful by including specific details in it:-)

Alasdair
-- 
agk at redhat.com



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-11-05 16:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-30 17:52 [PATCH] (2/11) various minor cleanups Petr Rockai
2008-11-05 15:54 ` Dave Wysochanski
2008-11-05 16:28   ` Alasdair G Kergon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.