public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* writev/readv dnotify confusion
@ 2002-11-29  6:58 Zou Pengcheng
  0 siblings, 0 replies; only message in thread
From: Zou Pengcheng @ 2002-11-29  6:58 UTC (permalink / raw)
  To: linux-kernel

hi,

not sure if dnotify is handled by writev/readv correctly,

below are some code of do_readv_writev() in linux/fs/read_write.c:

out_nofree:
        /* VERIFY_WRITE actually means a read, as we write to user space */
        if ((ret + (type == VERIFY_WRITE)) > 0)
                dnotify_parent(file->f_dentry,
                        (type == VERIFY_WRITE) ? DN_MODIFY : DN_ACCESS);
        return ret;
}

based on this code, it seems writev() sets DN_ACCESS while readv() sets 
DN_MODIFY.

i have also verified this by writing a testing program, in my testing program,
if just do fcntl(fd, F_NOTIFY, DN_MODIFY), on signal is raised after a 
writev(),  if i do fcntl(fd, F_NOTIFY, DN_ACCESS), then get the signal.

so wonder maybe the code above should be modified as something like:

out_nofree:
        /* VERIFY_WRITE actually means a read, as we write to user space */
        if ((ret + (type == VERIFY_WRITE)) > 0)
                dnotify_parent(file->f_dentry,
                        (type == VERIFY_WRITE) ? DN_ACCESS : DN_MODIFY);
        return ret;
}

cheers,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-11-29  6:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-29  6:58 writev/readv dnotify confusion Zou Pengcheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox