Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108305
b: refs/heads/master
c: a738159
h: refs/heads/master
i:
  108303: 0f9daae
v: v3
  • Loading branch information
Christoph Hellwig authored and Lachlan McIlroy committed Aug 13, 2008
1 parent 17abf25 commit f57fe87
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 18 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: 5e9da7b7a1edfc75a839b0269935393fa347f38b
refs/heads/master: a738159df2b97398f960978272944cbdd8f726ef
51 changes: 41 additions & 10 deletions trunk/fs/xfs/linux-2.6/xfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,15 @@ xfssyncd(
return 0;
}

STATIC void
xfs_free_fsname(
struct xfs_mount *mp)
{
kfree(mp->m_fsname);
kfree(mp->m_rtname);
kfree(mp->m_logname);
}

STATIC void
xfs_fs_put_super(
struct super_block *sb)
Expand Down Expand Up @@ -1261,6 +1270,7 @@ xfs_fs_put_super(
xfs_close_devices(mp);
xfs_qmops_put(mp);
xfs_dmops_put(mp);
xfs_free_fsname(mp);
kfree(mp);
}

Expand Down Expand Up @@ -1517,6 +1527,8 @@ xfs_start_flags(
struct xfs_mount_args *ap,
struct xfs_mount *mp)
{
int error;

/* Values are in BBs */
if ((ap->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) {
/*
Expand Down Expand Up @@ -1549,17 +1561,27 @@ xfs_start_flags(
ap->logbufsize);
return XFS_ERROR(EINVAL);
}

error = ENOMEM;

mp->m_logbsize = ap->logbufsize;
mp->m_fsname_len = strlen(ap->fsname) + 1;
mp->m_fsname = kmem_alloc(mp->m_fsname_len, KM_SLEEP);
strcpy(mp->m_fsname, ap->fsname);

mp->m_fsname = kstrdup(ap->fsname, GFP_KERNEL);
if (!mp->m_fsname)
goto out;

if (ap->rtname[0]) {
mp->m_rtname = kmem_alloc(strlen(ap->rtname) + 1, KM_SLEEP);
strcpy(mp->m_rtname, ap->rtname);
mp->m_rtname = kstrdup(ap->rtname, GFP_KERNEL);
if (!mp->m_rtname)
goto out_free_fsname;

}

if (ap->logname[0]) {
mp->m_logname = kmem_alloc(strlen(ap->logname) + 1, KM_SLEEP);
strcpy(mp->m_logname, ap->logname);
mp->m_logname = kstrdup(ap->logname, GFP_KERNEL);
if (!mp->m_logname)
goto out_free_rtname;
}

if (ap->flags & XFSMNT_WSYNC)
Expand Down Expand Up @@ -1632,6 +1654,14 @@ xfs_start_flags(
if (ap->flags & XFSMNT_DMAPI)
mp->m_flags |= XFS_MOUNT_DMAPI;
return 0;


out_free_rtname:
kfree(mp->m_rtname);
out_free_fsname:
kfree(mp->m_fsname);
out:
return error;
}

/*
Expand Down Expand Up @@ -1792,10 +1822,10 @@ xfs_fs_fill_super(
*/
error = xfs_start_flags(args, mp);
if (error)
goto out_destroy_counters;
goto out_free_fsname;
error = xfs_readsb(mp, flags);
if (error)
goto out_destroy_counters;
goto out_free_fsname;
error = xfs_finish_flags(args, mp);
if (error)
goto out_free_sb;
Expand Down Expand Up @@ -1857,7 +1887,8 @@ xfs_fs_fill_super(
xfs_filestream_unmount(mp);
out_free_sb:
xfs_freesb(mp);
out_destroy_counters:
out_free_fsname:
xfs_free_fsname(mp);
xfs_icsb_destroy_counters(mp);
xfs_close_devices(mp);
out_put_qmops:
Expand Down Expand Up @@ -1893,7 +1924,7 @@ xfs_fs_fill_super(
IRELE(mp->m_rootip);

xfs_unmountfs(mp);
goto out_destroy_counters;
goto out_free_fsname;
}

STATIC int
Expand Down
7 changes: 0 additions & 7 deletions trunk/fs/xfs/xfs_mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,6 @@ xfs_mount_free(
mutex_destroy(&mp->m_growlock);
if (mp->m_quotainfo)
XFS_QM_DONE(mp);

if (mp->m_fsname != NULL)
kmem_free(mp->m_fsname);
if (mp->m_rtname != NULL)
kmem_free(mp->m_rtname);
if (mp->m_logname != NULL)
kmem_free(mp->m_logname);
}

/*
Expand Down

0 comments on commit f57fe87

Please sign in to comment.