writev/readv dnotify confusion

Zou Pengcheng (pczou@redflag-linux.com)
Fri, 29 Nov 2002 14:58:12 +0800


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,
-
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/