The Linux Kernel Mailing List
 help / color / mirror / Atom feed
  • * Re: [PATCH v4] block: bio-integrity: Fix null-ptr-deref in bio_integrity_map_user()
           [not found] <20260427040926.987166-3-iam@sung-woo.kim>
           [not found] ` <afM2oyQTraSWa5vO@shinmob>
    @ 2026-05-07  7:51 ` Jens Axboe
      1 sibling, 0 replies; 2+ messages in thread
    From: Jens Axboe @ 2026-05-07  7:51 UTC (permalink / raw)
      To: Sungwoo Kim, Keith Busch
      Cc: Chao Shi, Weidong Zhu, Dave Tian, linux-block, linux-kernel
    
    > diff --git a/block/bio-integrity.c b/block/bio-integrity.c
    > index e54c6e06e1cb..766cc2d1d51c 100644
    > --- a/block/bio-integrity.c
    > +++ b/block/bio-integrity.c
    > @@ -403,6 +403,23 @@ int bio_integrity_map_user(struct bio *bio, struct iov_iter *iter)
    >  	if (unlikely(ret < 0))
    >  		goto free_bvec;
    >  
    > +	/* Handle partial pinning. This can happen when pin_user_pages_fast()
    > +	 * returns fewer pages than requested
    > +	 */
    
    Please follow the multi-line comment style used in the code around you.
    
    > +	if (user_backed_iter(iter) && unlikely(ret != bytes)) {
    > +		if (0 < ret) {
    
    And never do this, it's so much worse to read than if (ret > 0)
    
    -- 
    Jens Axboe
    
    ^ permalink raw reply	[flat|nested] 2+ messages in thread

  • end of thread, other threads:[~2026-05-07  7:51 UTC | newest]
    
    Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <20260427040926.987166-3-iam@sung-woo.kim>
         [not found] ` <afM2oyQTraSWa5vO@shinmob>
    2026-05-07  7:01   ` [PATCH v4] block: bio-integrity: Fix null-ptr-deref in bio_integrity_map_user() Sungwoo Kim
    2026-05-07  7:51 ` Jens Axboe
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox