aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/9p/vfs_inode.c')
-rw-r--r--fs/9p/vfs_inode.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 742bcd0dc4a7..d933ef1fbd8a 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -768,6 +768,7 @@ void
768v9fs_stat2inode(struct v9fs_stat *stat, struct inode *inode, 768v9fs_stat2inode(struct v9fs_stat *stat, struct inode *inode,
769 struct super_block *sb) 769 struct super_block *sb)
770{ 770{
771 int n;
771 char ext[32]; 772 char ext[32];
772 struct v9fs_session_info *v9ses = sb->s_fs_info; 773 struct v9fs_session_info *v9ses = sb->s_fs_info;
773 774
@@ -791,7 +792,11 @@ v9fs_stat2inode(struct v9fs_stat *stat, struct inode *inode,
791 int major = -1; 792 int major = -1;
792 int minor = -1; 793 int minor = -1;
793 794
794 v9fs_str_copy(ext, sizeof(ext), &stat->extension); 795 n = stat->extension.len;
796 if (n > sizeof(ext)-1)
797 n = sizeof(ext)-1;
798 memmove(ext, stat->extension.str, n);
799 ext[n] = 0;
795 sscanf(ext, "%c %u %u", &type, &major, &minor); 800 sscanf(ext, "%c %u %u", &type, &major, &minor);
796 switch (type) { 801 switch (type) {
797 case 'c': 802 case 'c':