From 59cf7a5118cd18b045ae97ad100c69da3aa203be Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 18 Jan 2004 18:57:00 -0800 Subject: [PATCH] [PATCH] kNFSd: Make sure dnotify events happen for NFS read and write. From: NeilBrown Based on code from Terje Malmedal --- fs/dnotify.c | 1 + fs/nfsd/vfs.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/dnotify.c b/fs/dnotify.c index f5eb816a814e8..bd5b433867d5b 100644 --- a/fs/dnotify.c +++ b/fs/dnotify.c @@ -165,6 +165,7 @@ void dnotify_parent(struct dentry *dentry, unsigned long event) spin_unlock(&dentry->d_lock); } } +EXPORT_SYMBOL_GPL(dnotify_parent); static int __init dnotify_init(void) { diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 96cb2eed9c113..880b8c4f03e46 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -43,6 +43,7 @@ #endif /* CONFIG_NFSD_V3 */ #include #include +#include #include @@ -680,6 +681,7 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, nfsdstats.io_read += err; *count = err; err = 0; + dnotify_parent(file.f_dentry, DN_ACCESS); } else err = nfserrno(err); out_close: @@ -745,9 +747,11 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, /* Write the data. */ oldfs = get_fs(); set_fs(KERNEL_DS); err = vfs_writev(&file, vec, vlen, &offset); - if (err >= 0) - nfsdstats.io_write += cnt; set_fs(oldfs); + if (err >= 0) { + nfsdstats.io_write += cnt; + dnotify_parent(file.f_dentry, DN_MODIFY); + } /* clear setuid/setgid flag after write */ if (err >= 0 && (inode->i_mode & (S_ISUID | S_ISGID))) { -- 2.53.0