public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Tomas Henzl <thenzl@redhat.com>
To: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@pmcs.com>,
	James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org
Cc: Mahesh.Rajashekhara@pmcs.com, Murthy.Bhat@pmcs.com,
	Gana.Sridaran@pmcs.com, aacraid@pmc-sierra.com,
	Scott.Benesh@pmcs.com, jthumshirn@suse.de, shane.seymour@hpe.com
Subject: Re: [PATCH V5 07/10] aacraid: Created new mutex for ioctl path
Date: Wed, 3 Feb 2016 11:37:31 +0100	[thread overview]
Message-ID: <56B1D86B.7000402@redhat.com> (raw)
In-Reply-To: <1454461088-32482-8-git-send-email-RaghavaAditya.Renukunta@pmcs.com>

On 3.2.2016 01:58, Raghava Aditya Renukunta wrote:
> aac_mutex was used to create protect the ioctl path for only the
> compat path, it would be make more sense to place mutex in
> aac_do_ioctl, which is the main ioctl function call that handles
> all ioctl commands.
>
> Created new mutex ioctl_mutex in struct aac_dev to protect switch
> case in aac_do_ioctl and removed aac_mutex from aac_cfg_ioctl and
> aac_compat_do_ioctl
>
> Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@pmcs.com>
> ---
>  drivers/scsi/aacraid/aacraid.h  |  1 +
>  drivers/scsi/aacraid/commctrl.c |  4 ++++
>  drivers/scsi/aacraid/linit.c    | 12 ++----------
>  3 files changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
> index 2916288..75bc65e 100644
> --- a/drivers/scsi/aacraid/aacraid.h
> +++ b/drivers/scsi/aacraid/aacraid.h
> @@ -1124,6 +1124,7 @@ struct aac_dev
>  	struct fib		*free_fib;
>  	spinlock_t		fib_lock;
>  
> +	struct mutex		ioctl_mutex;
>  	struct aac_queue_block *queues;
>  	/*
>  	 *	The user API will use an IOCTL to register itself to receive
> diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
> index 54195a1..4d5f4e7 100644
> --- a/drivers/scsi/aacraid/commctrl.c
> +++ b/drivers/scsi/aacraid/commctrl.c
> @@ -855,6 +855,8 @@ int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg)
>  {
>  	int status;
>  
> +	mutex_lock(&dev->ioctl_mutex);
> +

       status = aac_dev_ioctl(dev, cmd, arg);
        if (status != -ENOTTY)
                return status;

That return^ needs a mutex unlock .
--tms


  parent reply	other threads:[~2016-02-03 10:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03  0:57 [PATCH V5 00/10] aacraid: Patchset for aacraid driver version 41052 Raghava Aditya Renukunta
2016-02-03  0:57 ` [PATCH V5 01/10] aacraid: SCSI blk tag support Raghava Aditya Renukunta
2016-02-03  0:58 ` [PATCH V5 02/10] aacraid: Fix RRQ overload Raghava Aditya Renukunta
2016-02-03  0:58 ` [PATCH V5 03/10] aacraid: Added EEH support Raghava Aditya Renukunta
2016-02-03  0:58 ` [PATCH V5 04/10] aacraid: Fix memory leak in aac_fib_map_free Raghava Aditya Renukunta
2016-02-03  0:58 ` [PATCH V5 05/10] aacraid: Set correct msix count for EEH recovery Raghava Aditya Renukunta
2016-02-03  0:58 ` [PATCH V5 06/10] aacraid: Fundamental reset support for Series 7 Raghava Aditya Renukunta
2016-02-03  0:58 ` [PATCH V5 07/10] aacraid: Created new mutex for ioctl path Raghava Aditya Renukunta
2016-02-03  7:35   ` kbuild test robot
2016-02-03 10:37   ` Tomas Henzl [this message]
2016-02-03 22:49     ` Raghava Aditya Renukunta
2016-02-03  0:58 ` [PATCH V5 08/10] aacraid: Fix AIF triggered IOP_RESET Raghava Aditya Renukunta
2016-02-03 10:54   ` Tomas Henzl
2016-02-03 22:50     ` Raghava Aditya Renukunta
2016-02-03  0:58 ` [PATCH V5 09/10] aacraid: Fix character device re-initialization Raghava Aditya Renukunta
2016-02-03  0:58 ` [PATCH V5 10/10] aacraid: Update driver version Raghava Aditya Renukunta

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=56B1D86B.7000402@redhat.com \
    --to=thenzl@redhat.com \
    --cc=Gana.Sridaran@pmcs.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=Mahesh.Rajashekhara@pmcs.com \
    --cc=Murthy.Bhat@pmcs.com \
    --cc=RaghavaAditya.Renukunta@pmcs.com \
    --cc=Scott.Benesh@pmcs.com \
    --cc=aacraid@pmc-sierra.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=shane.seymour@hpe.com \
    /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