lkml.org 
[lkml]   [2015]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH] fs: use a sequence counter instead of file_lock in fd_install
From
Date
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.




\
 
 \ /
  Last update: 2015-04-21 23:41    [W:0.112 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site