]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - mm/shmem.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
[karo-tx-linux.git] / mm / shmem.c
index 3cdb243256f408b1365f719bfca525e7375b26ab..048a95a5244d4eb5522c7aa17fa94ca625f660f5 100644 (file)
@@ -1843,8 +1843,9 @@ shmem_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
 
        inode = shmem_get_inode(dir->i_sb, dir, mode, dev, VM_NORESERVE);
        if (inode) {
-               error = security_inode_init_security(inode, dir, NULL, NULL,
-                                                    NULL);
+               error = security_inode_init_security(inode, dir,
+                                                    &dentry->d_name, NULL,
+                                                    NULL, NULL);
                if (error) {
                        if (error != -EOPNOTSUPP) {
                                iput(inode);
@@ -1983,8 +1984,8 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s
        if (!inode)
                return -ENOSPC;
 
-       error = security_inode_init_security(inode, dir, NULL, NULL,
-                                            NULL);
+       error = security_inode_init_security(inode, dir, &dentry->d_name, NULL,
+                                            NULL, NULL);
        if (error) {
                if (error != -EOPNOTSUPP) {
                        iput(inode);
@@ -2144,8 +2145,10 @@ static int shmem_encode_fh(struct dentry *dentry, __u32 *fh, int *len,
 {
        struct inode *inode = dentry->d_inode;
 
-       if (*len < 3)
+       if (*len < 3) {
+               *len = 3;
                return 255;
+       }
 
        if (inode_unhashed(inode)) {
                /* Unfortunately insert_inode_hash is not idempotent,