Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299646
b: refs/heads/master
c: 98a2139
h: refs/heads/master
v: v3
  • Loading branch information
Jan Kara authored and Trond Myklebust committed Apr 20, 2012
1 parent cd9e3e6 commit 7608841
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ccd271f7a3a846ce6f85ead0760d9d12994a611
refs/heads/master: 98a2139f4f4d7b5fcc3a54c7fddbe88612abed20
8 changes: 6 additions & 2 deletions trunk/fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2767,11 +2767,15 @@ static struct vfsmount *nfs_do_root_mount(struct file_system_type *fs_type,
char *root_devname;
size_t len;

len = strlen(hostname) + 3;
len = strlen(hostname) + 5;
root_devname = kmalloc(len, GFP_KERNEL);
if (root_devname == NULL)
return ERR_PTR(-ENOMEM);
snprintf(root_devname, len, "%s:/", hostname);
/* Does hostname needs to be enclosed in brackets? */
if (strchr(hostname, ':'))
snprintf(root_devname, len, "[%s]:/", hostname);
else
snprintf(root_devname, len, "%s:/", hostname);
root_mnt = vfs_kern_mount(fs_type, flags, root_devname, data);
kfree(root_devname);
return root_mnt;
Expand Down

0 comments on commit 7608841

Please sign in to comment.