Re: [PATCH 1/5] ses: close potential registration race

2015-01-10 Thread Hannes Reinecke
On 12/30/2014 11:46 PM, Song Liu wrote:
 From: Dan Williams dan.j.willi...@intel.com
 
 The slot and address fields have a small window of instability when
 userspace can read them before initialization. Separate
 enclosure_component
 allocation from registration.
 
 Signed-off-by: Dan Williams dan.j.willi...@intel.com
 Signed-off-by: Song Liu songliubrav...@fb.com
 Reviewed-by: Jens Axboe ax...@fb.com
 Cc: Hannes Reinecke h...@suse.de

Reviewed-by: Hannes Reinecke h...@suse.de

Cheers,

Hannes
-- 
Dr. Hannes Reinecke   zSeries  Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 1/5] SES: close potential registration race

2014-09-12 Thread Song Liu
,
+   addl_desc_ptr);
+   if (create)
+   enclosure_component_register(
+   ecomp);
+   }
}
if (desc_ptr)
desc_ptr += len;
diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h
index 9a33c5f..a835d33 100644
--- a/include/linux/enclosure.h
+++ b/include/linux/enclosure.h
@@ -120,8 +120,9 @@ enclosure_register(struct device *, const char *, int,
   struct enclosure_component_callbacks *);
 void enclosure_unregister(struct enclosure_device *);
 struct enclosure_component *
-enclosure_component_register(struct enclosure_device *, unsigned int,
-enum enclosure_component_type, const char *);
+enclosure_component_alloc(struct enclosure_device *, unsigned int,
+ enum enclosure_component_type, const char *);
+int enclosure_component_register(struct enclosure_component *);
 int enclosure_add_device(struct enclosure_device *enclosure, int component,
 struct device *dev);
 int enclosure_remove_device(struct enclosure_device *, struct device *);
-- 
1.8.1


Thanks,
Song

 -Original Message-
 From: Hannes Reinecke [mailto:h...@suse.de]
 Sent: Thursday, September 4, 2014 12:51 AM
 To: Song Liu; linux-scsi@vger.kernel.org
 Cc: Dan Williams; Jens Axboe
 Subject: Re: [PATCH 1/5] SES: close potential registration race
 
 On 08/25/2014 07:34 PM, Song Liu wrote:
  From: Song Liu [mailto:songliubrav...@fb.com]
  Sent: Monday, August 25, 2014 10:26 AM
  To: Song Liu
  Cc: Dan Williams; Hannes Reinecke
  Subject: [PATCH 1/5] SES: close potential registration race
 
  From: Dan Williams dan.j.willi...@intel.com
 
  The slot and address fields have a small window of instability when 
  userspace
 can read them before initialization. Separate enclosure_component allocation
 from registration.
 
  Signed-off-by: Dan Williams dan.j.willi...@intel.com
  Signed-off-by: Song Liu songliubrav...@fb.com
  Reviewed-by: Jens Axboe ax...@fb.com
  Cc: Hannes Reinecke h...@suse.de
 Please run the patch against checkpatch.pl.
 It does have quite some coding-style issues.
 
 Cheers,
 
 Hannes
 --
 Dr. Hannes Reinecke zSeries  Storage
 h...@suse.de+49 911 74053 688
 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
 GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/5] SES: close potential registration race

2014-09-04 Thread Hannes Reinecke
On 08/25/2014 07:34 PM, Song Liu wrote:
 From: Song Liu [mailto:songliubrav...@fb.com] 
 Sent: Monday, August 25, 2014 10:26 AM
 To: Song Liu
 Cc: Dan Williams; Hannes Reinecke
 Subject: [PATCH 1/5] SES: close potential registration race
 
 From: Dan Williams dan.j.willi...@intel.com
 
 The slot and address fields have a small window of instability when userspace 
 can read them before initialization. Separate enclosure_component allocation 
 from registration.
 
 Signed-off-by: Dan Williams dan.j.willi...@intel.com
 Signed-off-by: Song Liu songliubrav...@fb.com
 Reviewed-by: Jens Axboe ax...@fb.com
 Cc: Hannes Reinecke h...@suse.de
Please run the patch against checkpatch.pl.
It does have quite some coding-style issues.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke   zSeries  Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html