Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964868AbbDUVG5 (ORCPT ); Tue, 21 Apr 2015 17:06:57 -0400 Received: from mail-ie0-f176.google.com ([209.85.223.176]:34768 "EHLO mail-ie0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932692AbbDUVGz (ORCPT ); Tue, 21 Apr 2015 17:06:55 -0400 Message-ID: <1429650413.18561.10.camel@edumazet-glaptop2.roam.corp.google.com> Subject: Re: [RFC PATCH] fs: use a sequence counter instead of file_lock in fd_install From: Eric Dumazet To: Mateusz Guzik Cc: Al Viro , Andrew Morton , "Paul E. McKenney" , Yann Droneaud , Konstantin Khlebnikov , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 21 Apr 2015 14:06:53 -0700 In-Reply-To: <20150421201201.GB16097@mguzik> References: <1429307216.7346.255.camel@edumazet-glaptop2.roam.corp.google.com> <20150417221646.GA15589@mguzik> <20150417230252.GE889@ZenIV.linux.org.uk> <20150420130633.GA2513@mguzik> <20150420134326.GC2513@mguzik> <20150420151054.GD2513@mguzik> <1429550126.7346.268.camel@edumazet-glaptop2.roam.corp.google.com> <1429562991.7346.290.camel@edumazet-glaptop2.roam.corp.google.com> <1429639543.7346.329.camel@edumazet-glaptop2.roam.corp.google.com> <20150421200624.GA16097@mguzik> <20150421201201.GB16097@mguzik> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 849 Lines: 29 On Tue, 2015-04-21 at 22:12 +0200, Mateusz Guzik wrote: > in dup_fd: > for (i = open_files; i != 0; i--) { > struct file *f = *old_fds++; > if (f) { > get_file(f); > I see no new requirement here. f is either NULL or not. multi threaded programs never had a guarantee dup_fd() would catch a non NULL pointer here. > at least a data dependency barrier, or maybe smp_rmb for peace of mind > > similarly in do_dup2: > tofree = fdt->fd[fd]; > if (!tofree && fd_is_open(fd, fdt)) > goto Ebusy; Same here. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/