From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933284AbcHWOsj (ORCPT ); Tue, 23 Aug 2016 10:48:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49122 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932989AbcHWOsi (ORCPT ); Tue, 23 Aug 2016 10:48:38 -0400 Date: Tue, 23 Aug 2016 16:48:13 +0200 From: Oleg Nesterov To: Mateusz Guzik Cc: Konstantin Khlebnikov , Richard Guy Briggs , ebiederm@xmission.com, sgrubb@redhat.com, pmoore@redhat.com, eparis@redhat.com, luto@amacapital.net, linux-audit@redhat.com, linux-kernel@vger.kernel.org, Al Viro Subject: Re: [PATCHv2 1/2] mm: introduce get_task_exe_file Message-ID: <20160823144812.GA2088@redhat.com> References: <1471962039-14940-1-git-send-email-mguzik@redhat.com> <1471962039-14940-2-git-send-email-mguzik@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1471962039-14940-2-git-send-email-mguzik@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 23 Aug 2016 14:48:37 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/23, Mateusz Guzik wrote: > > +struct file *get_task_exe_file(struct task_struct *task) > +{ > + struct file *exe_file = NULL; > + struct mm_struct *mm; > + > + task_lock(task); > + mm = task->mm; > + if (mm) { > + if (!(task->flags & PF_KTHREAD)) > + exe_file = get_mm_exe_file(mm); > + } > + task_unlock(task); > + return exe_file; > +} I can't believe I am going to comment the coding style but I can't resist ;) if (mm && !(task->flags & PF_KTHREAD))) exe_file = get_mm_exe_file(mm); looks a bit simpler to me. But this is purely cosmetic and subjective, both patches look good to me. Acked-by: Oleg Nesterov