linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
To: Hannes Reinecke <hare@suse.de>
Cc: JBottomley@parallels.com, jejb@kernel.org,
	Christoph Hellwig <hch@infradead.org>,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	Sathya Prakash <Sathya.Prakash@broadcom.com>,
	Kashyap Desai <kashyap.desai@broadcom.com>,
	Krishnaraddi Mankani <krishnaraddi.mankani@broadcom.com>,
	linux-kernel@vger.kernel.org,
	Chaitra Basappa <chaitra.basappa@broadcom.com>,
	Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Subject: Re: [PATCH 03/10] mpt3sas: Implement device_remove_in_progress check in IOCTL path
Date: Tue, 25 Oct 2016 16:06:57 +0530	[thread overview]
Message-ID: <CA+RiK67ABpPAX18i6P89cSwNZZNmNHHPAudhb4s3is0x9Zf2uA@mail.gmail.com> (raw)
In-Reply-To: <801507ae-e99d-2d1f-b4f5-163bf03227af@suse.de>

Hi Hannes,

Thanks,
>From facts.MaxDevHandle value from firmware, driver will get to know
the max device handle or devices that it can support. Based on that
value only driver will allocate memory for bit mapping.
And driver will not receive any events from controller, if it exceeds
the max devices it can support. So, there is No possibility that
driver can add more devices than bitmap.

Thanks,
Suganath Prabu S



On Tue, Oct 25, 2016 at 3:21 PM, Hannes Reinecke <hare@suse.de> wrote:
> On 10/25/2016 11:19 AM, Suganath Prabu Subramani wrote:
>> Hi Hannes,
>>
>> Please give us little more info on the third comment. It ll help us to
>> understand better and
>> incorporate required changes.
>>
>> Comment is  "Why don't you need to check for the size of the bitmap here?"
>>
>> i have taken care of other two comments in this patch.
>>
>>>       /* check if device is present */
>>> @@ -5467,6 +5482,7 @@ _scsih_add_device(struct MPT3SAS_ADAPTER *ioc, u16 handle, u8 phy_num,
>>>         sas_device = mpt3sas_get_sdev_by_addr(ioc,
>>>                                         sas_address);
>>>         if (sas_device) {
>>> +               clear_bit(handle, ioc->pend_os_device_add);
>>>                 sas_device_put(sas_device);
>>>                 return -1;
>>>         }
>>
>> Why don't you need to check for the size of the bitmap here?
>>
>>
> Thing is, you are using 'ioc->pend_os_device_add' as a bitmap to track
> which devices to add.
> Which in turn means that the overall number of devices you _can_ add is
> restricted by the size of the bitmap.
> But as you're adding devices you (might) increase the number of devices,
> potentially overflowing the bitmap.
> Hence the question: is it possible that you can add _more_ devices than
> the bitmap can hold?
> Or, to put it the other way round: Why don't you need to check the size
> of the bitmap to avoid accessing an invalid bit beyond the end of the mask?
>
> Cheers,
>
> Hannes
> --
> Dr. Hannes Reinecke                Teamlead Storage & Networking
> hare@suse.de                                   +49 911 74053 688
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
> HRB 21284 (AG Nürnberg)

  reply	other threads:[~2016-10-25 10:37 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20 12:20 [PATCH 00/10] mpt3sas driver Enhancements and Suganath Prabu S
2016-10-20 12:20 ` [PATCH 01/10] mpt3sas: Fix for improper info displayed in var log, while blocking or unblocking the device Suganath Prabu S
2016-10-24 14:44   ` Hannes Reinecke
2016-10-25 14:37   ` Tomas Henzl
2016-10-20 12:20 ` [PATCH 02/10] mpt3sas: Fix for incorrect numbers for MSIX vectors enabled when non RDPQ card is enumerated first Suganath Prabu S
2016-10-24 14:44   ` Hannes Reinecke
2016-10-25 14:38   ` Tomas Henzl
2016-10-20 12:20 ` [PATCH 03/10] mpt3sas: Implement device_remove_in_progress check in IOCTL path Suganath Prabu S
2016-10-24 14:47   ` Hannes Reinecke
2016-10-25  9:19     ` Suganath Prabu Subramani
2016-10-25  9:51       ` Hannes Reinecke
2016-10-25 10:36         ` Suganath Prabu Subramani [this message]
2016-10-20 12:20 ` [PATCH 04/10] mpt3sas: Removing unused macro "MPT_DEVICE_TLR_ON" Suganath Prabu S
2016-10-24 14:47   ` Hannes Reinecke
2016-10-25 14:38   ` Tomas Henzl
2016-10-20 12:20 ` [PATCH 05/10] mpt3sas: Bump driver version as "14.100.00.00" Suganath Prabu S
2016-10-24 14:48   ` Hannes Reinecke
2016-10-20 12:20 ` [PATCH 06/10] mpt3sas: Added Device ID's for SAS35 devices and updated MPI header Suganath Prabu S
2016-10-24 14:49   ` Hannes Reinecke
2016-10-25 14:40   ` Tomas Henzl
2016-10-20 12:20 ` [PATCH 07/10] mpt3sas: Increased/Additional MSIX support for SAS35 devices Suganath Prabu S
2016-10-24 14:50   ` Hannes Reinecke
2016-10-25 14:41   ` Tomas Henzl
2016-10-20 12:20 ` [PATCH 08/10] mpt3sas: set EEDP-escape-flags " Suganath Prabu S
2016-10-24 14:51   ` Hannes Reinecke
2016-10-25 14:42   ` Tomas Henzl
2016-10-20 12:20 ` [PATCH 09/10] mpt3sas: Use the new MPI 2.6 32-bit Atomic Request Descriptors " Suganath Prabu S
2016-10-24 14:52   ` Hannes Reinecke
2016-10-25 14:47   ` Tomas Henzl
2016-10-20 12:20 ` [PATCH 10/10] mpt3sas: Fix for Endianness issue Suganath Prabu S
2016-10-24 14:53   ` Hannes Reinecke
2016-10-25 14:48   ` Tomas Henzl
2016-10-25  1:17 ` [PATCH 00/10] mpt3sas driver Enhancements and Martin K. Petersen

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=CA+RiK67ABpPAX18i6P89cSwNZZNmNHHPAudhb4s3is0x9Zf2uA@mail.gmail.com \
    --to=suganath-prabu.subramani@broadcom.com \
    --cc=JBottomley@parallels.com \
    --cc=Sathya.Prakash@broadcom.com \
    --cc=chaitra.basappa@broadcom.com \
    --cc=hare@suse.de \
    --cc=hch@infradead.org \
    --cc=jejb@kernel.org \
    --cc=kashyap.desai@broadcom.com \
    --cc=krishnaraddi.mankani@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sreekanth.reddy@broadcom.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;
as well as URLs for NNTP newsgroup(s).