linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Pete Zaitcev <zaitcev@redhat.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
	Andrew Morton <akpm@linux-foundation.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-mm@kvack.org, linux-usb@vger.kernel.org
Subject: Re: kernel BUG at ./include/linux/mm.h:LINE! (3)
Date: Wed, 3 Jan 2018 13:08:12 -0800	[thread overview]
Message-ID: <20180103210812.GC3228@bombadil.infradead.org> (raw)
In-Reply-To: <20180103150419.2fefd759@lembas.zaitcev.lan>

On Wed, Jan 03, 2018 at 03:04:19PM -0600, Pete Zaitcev wrote:
> @@ -1231,12 +1233,15 @@ static int mon_bin_vma_fault(struct vm_fault *vmf)
>  	unsigned long offset, chunk_idx;
>  	struct page *pageptr;
>  
> +	mutex_lock(&rp->fetch_lock);
>  	offset = vmf->pgoff << PAGE_SHIFT;
>  	if (offset >= rp->b_size)
> +		mutex_unlock(&rp->fetch_lock);
>  		return VM_FAULT_SIGBUS;
>  	chunk_idx = offset / CHUNK_SIZE;

missing braces ... maybe you'd rather a 'goto sigbus' approach?

>  	pageptr = rp->b_vec[chunk_idx].pg;
>  	get_page(pageptr);
> +	mutex_unlock(&rp->fetch_lock);
>  	vmf->page = pageptr;
>  	return 0;
>  }
> 
> -- Pete
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2018-01-03 21:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-29  0:03 Fw: " Andrew Morton
2017-12-29 13:24 ` Kirill A. Shutemov
2018-01-03  7:02   ` Pete Zaitcev
2018-01-03  9:26     ` Kirill A. Shutemov
2018-01-03 21:04       ` Pete Zaitcev
2018-01-03 21:08         ` Matthew Wilcox [this message]
2018-01-04  0:42           ` Pete Zaitcev
2018-01-08 21:25       ` Pete Zaitcev
2018-01-08 21:46       ` [PATCH] The usbmon triggers a BUG in ./include/linux/mm.h Pete Zaitcev
2018-01-09 15:03         ` Greg Kroah-Hartman
2018-01-08  5:22   ` kernel BUG at ./include/linux/mm.h:LINE! (3) Pete Zaitcev

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=20180103210812.GC3228@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kirill@shutemov.name \
    --cc=linux-mm@kvack.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=zaitcev@redhat.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