diff options
Diffstat (limited to 'fs/9p/vfs_inode.c')
-rw-r--r-- | fs/9p/vfs_inode.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 5fe45d692c9f..f2434fc9d2c4 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/namei.h> | 34 | #include <linux/namei.h> |
35 | #include <linux/idr.h> | 35 | #include <linux/idr.h> |
36 | #include <linux/sched.h> | 36 | #include <linux/sched.h> |
37 | #include <linux/slab.h> | ||
37 | #include <net/9p/9p.h> | 38 | #include <net/9p/9p.h> |
38 | #include <net/9p/client.h> | 39 | #include <net/9p/client.h> |
39 | 40 | ||
@@ -431,6 +432,7 @@ error: | |||
431 | 432 | ||
432 | static int v9fs_remove(struct inode *dir, struct dentry *file, int rmdir) | 433 | static int v9fs_remove(struct inode *dir, struct dentry *file, int rmdir) |
433 | { | 434 | { |
435 | int retval; | ||
434 | struct inode *file_inode; | 436 | struct inode *file_inode; |
435 | struct v9fs_session_info *v9ses; | 437 | struct v9fs_session_info *v9ses; |
436 | struct p9_fid *v9fid; | 438 | struct p9_fid *v9fid; |
@@ -444,7 +446,10 @@ static int v9fs_remove(struct inode *dir, struct dentry *file, int rmdir) | |||
444 | if (IS_ERR(v9fid)) | 446 | if (IS_ERR(v9fid)) |
445 | return PTR_ERR(v9fid); | 447 | return PTR_ERR(v9fid); |
446 | 448 | ||
447 | return p9_client_remove(v9fid); | 449 | retval = p9_client_remove(v9fid); |
450 | if (!retval) | ||
451 | drop_nlink(file_inode); | ||
452 | return retval; | ||
448 | } | 453 | } |
449 | 454 | ||
450 | static int | 455 | static int |
@@ -656,6 +661,9 @@ static struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, | |||
656 | P9_DPRINTK(P9_DEBUG_VFS, "dir: %p dentry: (%s) %p nameidata: %p\n", | 661 | P9_DPRINTK(P9_DEBUG_VFS, "dir: %p dentry: (%s) %p nameidata: %p\n", |
657 | dir, dentry->d_name.name, dentry, nameidata); | 662 | dir, dentry->d_name.name, dentry, nameidata); |
658 | 663 | ||
664 | if (dentry->d_name.len > NAME_MAX) | ||
665 | return ERR_PTR(-ENAMETOOLONG); | ||
666 | |||
659 | sb = dir->i_sb; | 667 | sb = dir->i_sb; |
660 | v9ses = v9fs_inode2v9ses(dir); | 668 | v9ses = v9fs_inode2v9ses(dir); |
661 | dfid = v9fs_fid_lookup(dentry->d_parent); | 669 | dfid = v9fs_fid_lookup(dentry->d_parent); |