From: Andre Noll <maan@systemlinux.org>
To: Neil Brown <neilb@suse.de>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
linux-raid <linux-raid@vger.kernel.org>
Subject: Re: [PATCH/Resend] md: Push down data integrity code to personalities.
Date: Mon, 3 Aug 2009 18:40:30 +0200 [thread overview]
Message-ID: <20090803164030.GI5174@skl-net.de> (raw)
In-Reply-To: <19058.31706.803177.77914@notabene.brown>
[-- Attachment #1: Type: text/plain, Size: 1838 bytes --]
On 15:06, Neil Brown wrote:
> > Here is a revised patch that puts calls to the new functions into
> > the ->hot_*_disk methods as you propose.
>
> Thanks. Much better.
> Calling md_integrity_check from the ->error routines isn't a good idea
> though. They can be called in interrupt context, and
> md_integrity_check can call kmalloc(..., GFP_KERNEL) which might try
> to sleep. That would be bad.
> We don't need the call in ->error, having it in ->hot_remove_disk is
> adequate, as that is called soon after any failure (it doesn't wait
> for the sysadmin to "mdadm --remove ...".).
>
> So I have made that change and updated the comment accordingly.
Thanks. Sorry if this is a FAQ, but how can one tell whether a given
function may be called in interrupt context? Is there a better way
than recursively checking all its callers?
> > Side note: The patch causes the new gcc warning
> >
> > drivers/md/md.c: In function 'md_integrity_add_rdev':
> > drivers/md/md.c:1546: warning: unused variable 'gd'
> >
> > if data integrity is not compiled in. Any ideas on how to avoid it
> > without introducing an #ifdef-mess are welcome.
>
> I just replaced ever occurrence of "gd" with "mddev->gendisk". It
> isn't too ugly.
> Alternately, blkdev.h could have
>
> static inline struct blk_integrity *blk_get_integrity(struct gendisk *disk)
> {
> return NULL;
> }
>
> in place of
>
> #define blk_get_integrity(a) (0)
>
> and then there would be no complaints about unused variables, and
> slightly improved type checking.
IMO this second alternative is be a bit cleaner and it might help
other users of blk_get_integrity() as well. Martin, are you OK with
this change to blkdev.h?
Regards
Andre
--
The only person who always got his work done by Friday was Robinson Crusoe
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2009-08-03 16:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-01 8:38 [PATCH/Resend] md: Push down data integrity code to personalities Andre Noll
2009-07-07 3:42 ` Neil Brown
2009-07-07 13:44 ` Andre Noll
2009-07-07 22:10 ` Bill Davidsen
2009-07-13 8:54 ` Andre Noll
2009-07-31 5:06 ` Neil Brown
2009-08-03 16:40 ` Andre Noll [this message]
2009-08-04 5:28 ` Martin K. Petersen
2009-08-06 8:37 ` Andre Noll
2009-08-07 4:48 ` Martin K. Petersen
2009-08-06 3:31 ` Neil Brown
2009-08-07 16:46 ` Andre Noll
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=20090803164030.GI5174@skl-net.de \
--to=maan@systemlinux.org \
--cc=linux-raid@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=neilb@suse.de \
/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).