Skip to content

Commit 6badd79

Browse files
author
Al Viro
committed
kill ->dir_notify()
Remove the hopelessly misguided ->dir_notify(). The only instance (cifs) has been broken by design from the very beginning; the objects it creates are never destroyed, keep references to struct file they can outlive, nothing that could possibly evict them exists on close(2) path *and* no locking whatsoever is done to prevent races with close(), should the previous, er, deficiencies someday be dealt with. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent b6b3fde commit 6badd79

9 files changed

Lines changed: 1 addition & 142 deletions

File tree

‎Documentation/filesystems/Locking‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ prototypes:
394394
unsigned long (*get_unmapped_area)(struct file *, unsigned long,
395395
unsigned long, unsigned long, unsigned long);
396396
int (*check_flags)(int);
397-
int (*dir_notify)(struct file *, unsigned long);
398397
};
399398

400399
locking rules:
@@ -424,7 +423,6 @@ sendfile: no
424423
sendpage: no
425424
get_unmapped_area: no
426425
check_flags: no
427-
dir_notify: no
428426

429427
->llseek() locking has moved from llseek to the individual llseek
430428
implementations. If your fs is not using generic_file_llseek, you

‎Documentation/filesystems/vfs.txt‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,6 @@ struct file_operations {
733733
ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
734734
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
735735
int (*check_flags)(int);
736-
int (*dir_notify)(struct file *filp, unsigned long arg);
737736
int (*flock) (struct file *, int, struct file_lock *);
738737
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, size_t, unsigned int);
739738
ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned int);
@@ -800,8 +799,6 @@ otherwise noted.
800799

801800
check_flags: called by the fcntl(2) system call for F_SETFL command
802801

803-
dir_notify: called by the fcntl(2) system call for F_NOTIFY command
804-
805802
flock: called by the flock(2) system call
806803

807804
splice_write: called by the VFS to splice data from a pipe to a file. This

‎fs/bad_inode.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,6 @@ static int bad_file_check_flags(int flags)
132132
return -EIO;
133133
}
134134

135-
static int bad_file_dir_notify(struct file *file, unsigned long arg)
136-
{
137-
return -EIO;
138-
}
139-
140135
static int bad_file_flock(struct file *filp, int cmd, struct file_lock *fl)
141136
{
142137
return -EIO;
@@ -179,7 +174,6 @@ static const struct file_operations bad_file_ops =
179174
.sendpage = bad_file_sendpage,
180175
.get_unmapped_area = bad_file_get_unmapped_area,
181176
.check_flags = bad_file_check_flags,
182-
.dir_notify = bad_file_dir_notify,
183177
.flock = bad_file_flock,
184178
.splice_write = bad_file_splice_write,
185179
.splice_read = bad_file_splice_read,

‎fs/cifs/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ obj-$(CONFIG_CIFS) += cifs.o
55

66
cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \
77
link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o \
8-
md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o fcntl.o \
8+
md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o \
99
readdir.o ioctl.o sess.o export.o cifsacl.o
1010

1111
cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o

‎fs/cifs/cifsfs.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,6 @@ const struct file_operations cifs_file_ops = {
747747
#endif /* CONFIG_CIFS_POSIX */
748748

749749
#ifdef CONFIG_CIFS_EXPERIMENTAL
750-
.dir_notify = cifs_dir_notify,
751750
.setlease = cifs_setlease,
752751
#endif /* CONFIG_CIFS_EXPERIMENTAL */
753752
};
@@ -768,7 +767,6 @@ const struct file_operations cifs_file_direct_ops = {
768767
#endif /* CONFIG_CIFS_POSIX */
769768
.llseek = cifs_llseek,
770769
#ifdef CONFIG_CIFS_EXPERIMENTAL
771-
.dir_notify = cifs_dir_notify,
772770
.setlease = cifs_setlease,
773771
#endif /* CONFIG_CIFS_EXPERIMENTAL */
774772
};
@@ -789,7 +787,6 @@ const struct file_operations cifs_file_nobrl_ops = {
789787
#endif /* CONFIG_CIFS_POSIX */
790788

791789
#ifdef CONFIG_CIFS_EXPERIMENTAL
792-
.dir_notify = cifs_dir_notify,
793790
.setlease = cifs_setlease,
794791
#endif /* CONFIG_CIFS_EXPERIMENTAL */
795792
};
@@ -809,7 +806,6 @@ const struct file_operations cifs_file_direct_nobrl_ops = {
809806
#endif /* CONFIG_CIFS_POSIX */
810807
.llseek = cifs_llseek,
811808
#ifdef CONFIG_CIFS_EXPERIMENTAL
812-
.dir_notify = cifs_dir_notify,
813809
.setlease = cifs_setlease,
814810
#endif /* CONFIG_CIFS_EXPERIMENTAL */
815811
};
@@ -818,9 +814,6 @@ const struct file_operations cifs_dir_ops = {
818814
.readdir = cifs_readdir,
819815
.release = cifs_closedir,
820816
.read = generic_read_dir,
821-
#ifdef CONFIG_CIFS_EXPERIMENTAL
822-
.dir_notify = cifs_dir_notify,
823-
#endif /* CONFIG_CIFS_EXPERIMENTAL */
824817
.unlocked_ioctl = cifs_ioctl,
825818
.llseek = generic_file_llseek,
826819
};

‎fs/cifs/cifsfs.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ extern int cifs_file_mmap(struct file * , struct vm_area_struct *);
7676
extern const struct file_operations cifs_dir_ops;
7777
extern int cifs_dir_open(struct inode *inode, struct file *file);
7878
extern int cifs_readdir(struct file *file, void *direntry, filldir_t filldir);
79-
extern int cifs_dir_notify(struct file *, unsigned long arg);
8079

8180
/* Functions related to dir entries */
8281
extern struct dentry_operations cifs_dentry_ops;

‎fs/cifs/fcntl.c‎

Lines changed: 0 additions & 118 deletions
This file was deleted.

‎fs/dnotify.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
115115
dn->dn_next = inode->i_dnotify;
116116
inode->i_dnotify = dn;
117117
spin_unlock(&inode->i_lock);
118-
119-
if (filp->f_op && filp->f_op->dir_notify)
120-
return filp->f_op->dir_notify(filp, arg);
121118
return 0;
122119

123120
out_free:

‎include/linux/fs.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,6 @@ struct file_operations {
13091309
ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
13101310
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
13111311
int (*check_flags)(int);
1312-
int (*dir_notify)(struct file *filp, unsigned long arg);
13131312
int (*flock) (struct file *, int, struct file_lock *);
13141313
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
13151314
ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);

0 commit comments

Comments
 (0)