hostfs: fix UML crash: remove f_spare from hostfs
authorRichard Weinberger <richard@nod.at>
Tue, 19 Oct 2010 21:27:59 +0000 (14:27 -0700)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 26 Oct 2010 01:18:21 +0000 (21:18 -0400)
365b1818 ("add f_flags to struct statfs(64)") resized f_spare within
struct statfs which caused a UML crash.  There is no need to copy f_spare.

Signed-off-by: Richard Weinberger <richard@nod.at>
Reported-by: Toralf Förster <toralf.foerster@gmx.de>
Tested-by: Toralf Förster <toralf.foerster@gmx.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/hostfs/hostfs.h
fs/hostfs/hostfs_kern.c
fs/hostfs/hostfs_user.c

index 7c232c1487ee761f3557a705a49a2fc7e9da5fb1..bf15a43016b91b5e342bb16a442a19f4e9dadd33 100644 (file)
@@ -91,7 +91,6 @@ extern int rename_file(char *from, char *to);
 extern int do_statfs(char *root, long *bsize_out, long long *blocks_out,
                     long long *bfree_out, long long *bavail_out,
                     long long *files_out, long long *ffree_out,
-                    void *fsid_out, int fsid_size, long *namelen_out,
-                    long *spare_out);
+                    void *fsid_out, int fsid_size, long *namelen_out);
 
 #endif
index f7dc9b5f9ef8c80560cb545d937aa9818a3b646f..cd7c93917cc7c29636ee7c87a8846177e4098d23 100644 (file)
@@ -217,7 +217,7 @@ int hostfs_statfs(struct dentry *dentry, struct kstatfs *sf)
        err = do_statfs(dentry->d_sb->s_fs_info,
                        &sf->f_bsize, &f_blocks, &f_bfree, &f_bavail, &f_files,
                        &f_ffree, &sf->f_fsid, sizeof(sf->f_fsid),
-                       &sf->f_namelen, sf->f_spare);
+                       &sf->f_namelen);
        if (err)
                return err;
        sf->f_blocks = f_blocks;
index 6777aa06ce2cc894de1885f65c4d145e9bc8f0a8..8d02683585e0c80f60d0587c78768455f7db72b8 100644 (file)
@@ -364,8 +364,7 @@ int rename_file(char *from, char *to)
 int do_statfs(char *root, long *bsize_out, long long *blocks_out,
              long long *bfree_out, long long *bavail_out,
              long long *files_out, long long *ffree_out,
-             void *fsid_out, int fsid_size, long *namelen_out,
-             long *spare_out)
+             void *fsid_out, int fsid_size, long *namelen_out)
 {
        struct statfs64 buf;
        int err;
@@ -384,10 +383,6 @@ int do_statfs(char *root, long *bsize_out, long long *blocks_out,
               sizeof(buf.f_fsid) > fsid_size ? fsid_size :
               sizeof(buf.f_fsid));
        *namelen_out = buf.f_namelen;
-       spare_out[0] = buf.f_spare[0];
-       spare_out[1] = buf.f_spare[1];
-       spare_out[2] = buf.f_spare[2];
-       spare_out[3] = buf.f_spare[3];
-       spare_out[4] = buf.f_spare[4];
+
        return 0;
 }