linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Andrew Morton <akpm@linux-foundation.org>, Jan Kara <jack@suse.cz>
Cc: Linux-Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Shakeel Butt <shakeelb@google.com>
Subject: linux-next: manual merge of the akpm-current tree with the ext3 tree
Date: Tue, 27 Feb 2018 14:11:53 +1100	[thread overview]
Message-ID: <20180227141153.417a520e@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 3495 bytes --]

Hi Andrew,

Today's linux-next merge of the akpm-current tree got conflicts in:

  fs/notify/fanotify/fanotify.c
  fs/notify/fanotify/fanotify.h
  fs/notify/fanotify/fanotify_user.c
  fs/notify/inotify/inotify_fsnotify.c

between commits:

  1e301852d657 ("fanotify: Avoid lost events due to ENOMEM for unlimited queues")
  b900420e4109 ("fsnotify: Let userspace know about lost events due to ENOMEM")

from the ext3 tree and commit:

  d519ceef2ad6 ("fs: fsnotify: account fsnotify metadata to kmemcg")

from the akpm-current tree.

I fixed it up (see below - I simplified the obvious resolution a bit) and
can carry the fix as necessary. This is now fixed as far as linux-next
is concerned, but any non trivial conflicts should be mentioned to your
upstream maintainer when your tree is submitted for merging.  You may
also want to consider cooperating with the maintainer of the conflicting
tree to minimise any particularly complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/notify/fanotify/fanotify.c
index d51e1bb781cf,0d9493ebc7cd..000000000000
--- a/fs/notify/fanotify/fanotify.c
+++ b/fs/notify/fanotify/fanotify.c
@@@ -157,14 -148,16 +157,16 @@@ struct fanotify_event_info *fanotify_al
  	if (fanotify_is_perm_event(mask)) {
  		struct fanotify_perm_event_info *pevent;
  
- 		pevent = kmem_cache_alloc(fanotify_perm_event_cachep, gfp);
+ 		pevent = kmem_cache_alloc_memcg(fanotify_perm_event_cachep,
 -						GFP_KERNEL, memcg);
++						gfp, group->memcg);
  		if (!pevent)
  			return NULL;
  		event = &pevent->fae;
  		pevent->response = 0;
  		goto init;
  	}
- 	event = kmem_cache_alloc(fanotify_event_cachep, gfp);
 -	event = kmem_cache_alloc_memcg(fanotify_event_cachep, GFP_KERNEL,
 -				       memcg);
++	event = kmem_cache_alloc_memcg(fanotify_event_cachep, gfp,
++				       group->memcg);
  	if (!event)
  		return NULL;
  init: __maybe_unused
diff --cc fs/notify/fanotify/fanotify.h
index 8609ba06f474,51b797896c87..000000000000
--- a/fs/notify/fanotify/fanotify.h
+++ b/fs/notify/fanotify/fanotify.h
diff --cc fs/notify/fanotify/fanotify_user.c
index 72e367822efb,e5e5983051c0..000000000000
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@@ -756,8 -757,9 +757,9 @@@ SYSCALL_DEFINE2(fanotify_init, unsigne
  
  	group->fanotify_data.user = user;
  	atomic_inc(&user->fanotify_listeners);
+ 	group->memcg = get_mem_cgroup_from_mm(current->mm);
  
 -	oevent = fanotify_alloc_event(NULL, FS_Q_OVERFLOW, NULL, group->memcg);
 +	oevent = fanotify_alloc_event(group, NULL, FS_Q_OVERFLOW, NULL);
  	if (unlikely(!oevent)) {
  		fd = -ENOMEM;
  		goto out_destroy_group;
diff --cc fs/notify/inotify/inotify_fsnotify.c
index 40dedb37a1f3,ed8e7b5f3981..000000000000
--- a/fs/notify/inotify/inotify_fsnotify.c
+++ b/fs/notify/inotify/inotify_fsnotify.c
@@@ -98,15 -98,9 +98,15 @@@ int inotify_handle_event(struct fsnotif
  	i_mark = container_of(inode_mark, struct inotify_inode_mark,
  			      fsn_mark);
  
- 	event = kmalloc(alloc_len, GFP_KERNEL);
+ 	event = kmalloc_memcg(alloc_len, GFP_KERNEL, group->memcg);
 -	if (unlikely(!event))
 +	if (unlikely(!event)) {
 +		/*
 +		 * Treat lost event due to ENOMEM the same way as queue
 +		 * overflow to let userspace know event was lost.
 +		 */
 +		fsnotify_queue_overflow(group);
  		return -ENOMEM;
 +	}
  
  	fsn_event = &event->fse;
  	fsnotify_init_event(fsn_event, inode, mask);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2018-02-27  3:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27  3:11 Stephen Rothwell [this message]
2018-02-27  9:36 ` linux-next: manual merge of the akpm-current tree with the ext3 tree Jan Kara
  -- strict thread matches above, loose matches on Subject: below --
2014-11-11  6:55 Stephen Rothwell
2014-02-26  7:32 Stephen Rothwell

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=20180227141153.417a520e@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=shakeelb@google.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).