util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Davidlohr Bueso <dave@gnu.org>
Cc: Petr Uzel <petr.uzel@suse.cz>, util-linux <util-linux@vger.kernel.org>
Subject: Re: [PATCH 3/3] fdisk: dos: always write mbr
Date: Wed, 14 Nov 2012 10:43:58 +0100	[thread overview]
Message-ID: <20121114094358.GB1835@x2.net.home> (raw)
In-Reply-To: <1352880292.2577.5.camel@offbook>

On Wed, Nov 14, 2012 at 12:04:52AM -0800, Davidlohr Bueso wrote:
> There's no harm when writing the MBR, changed or not. This also

it's harm -- kernel has to parse the new PT, udev has to scan all the
stuff etc. ... many event and every event is painful if you have
complicated setup (DM, multipath, udisks, ...).

> allows us to get rid of the 'MBRbuffer_changed' global variable.

It would be nice to add to fdisk_context

    void *labeldata;

 and define in fdiskdos.h

 struct fdisk_dosdata {
    int write_status;             /* FDISKDOS_WRITE_* flags */
    ...
 }

 enum {
    FDISKDOS_WRITE_HDR     = (1 << 1)  /* header buffer modified (e.g. ID change) */
    FDISKDOS_WRITE_PT      = (1 << 2)  /* partition table modified */
    FDISKDOS_WRITE_EPT     = (1 << 3)  /* any extended partition table modified */
 };

(maybe you found better names for the macros and variables :-)


 than we can add fdisk_is_modified() and is_modified() to fdisk_label
 driver and remove all label specific junk from fdisk.c.

    Karel


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2012-11-14  9:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-14  8:04 [PATCH 3/3] fdisk: dos: always write mbr Davidlohr Bueso
2012-11-14  9:43 ` Karel Zak [this message]
2012-11-26  4:23   ` Davidlohr Bueso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121114094358.GB1835@x2.net.home \
    --to=kzak@redhat.com \
    --cc=dave@gnu.org \
    --cc=petr.uzel@suse.cz \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).