--- linux-2.6.29/fs/squashfs/export.c 2009-06-10 07:05:27 +0400 +++ linux-2.6.27/fs/squashfs/export.c 2009-06-19 18:07:55 +0400 @@ -76,14 +76,30 @@ static struct dentry *squashfs_export_ig unsigned int ino_num) { long long ino; - struct dentry *dentry = ERR_PTR(-ENOENT); + struct dentry *dentry; + struct inode *i; TRACE("Entered squashfs_export_iget\n"); ino = squashfs_inode_lookup(sb, ino_num); - if (ino >= 0) - dentry = d_obtain_alias(squashfs_iget(sb, ino, ino_num)); + if (ino < 0) { + dentry = ERR_PTR(-ENOENT); + goto failure; + } + + i = squashfs_iget(sb, ino, ino_num); + if (i == NULL) { + dentry = ERR_PTR(-EACCES); + goto failure; + } + + dentry = d_alloc_anon(i); + if (dentry == NULL) { + iput(i); + dentry = ERR_PTR(-ENOMEM); + } +failure: return dentry; } --- linux-2.6.29/fs/squashfs/squashfs_fs.h 2009-06-10 07:05:27 +0400 +++ linux-2.6.27/fs/squashfs/squashfs_fs.h 2009-06-19 18:07:55 +0400 @@ -23,6 +23,8 @@ * squashfs_fs.h */ +#define SQUASHFS_MAGIC 0x73717368 + #define SQUASHFS_CACHED_FRAGMENTS CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE #define SQUASHFS_MAJOR 4 #define SQUASHFS_MINOR 0