mm: memcontrol: remove dead code from memory_max_write()
authorJohannes Weiner <hannes@cmpxchg.org>
Sun, 1 Dec 2019 01:50:06 +0000 (17:50 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 1 Dec 2019 14:29:18 +0000 (06:29 -0800)
When the reclaim loop in memory_max_write() is ^C'd or similar, we set err
to -EINTR.  But we don't return err.  Once the limit is set, we always
return success (nbytes).  Delete the dead code.

Link: http://lkml.kernel.org/r/20191022201518.341216-1-hannes@cmpxchg.org
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memcontrol.c

index 2788fd5..2bd6d47 100644 (file)
@@ -6139,10 +6139,8 @@ static ssize_t memory_max_write(struct kernfs_open_file *of,
                if (nr_pages <= max)
                        break;
 
-               if (signal_pending(current)) {
-                       err = -EINTR;
+               if (signal_pending(current))
                        break;
-               }
 
                if (!drained) {
                        drain_all_stock(memcg);