]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
cramfs: only unlock new inodes
authorAlexander Shishkin <virtuoso@slind.org>
Tue, 17 Aug 2010 14:08:35 +0000 (17:08 +0300)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 18 Aug 2010 05:01:33 +0000 (01:01 -0400)
Commit 77b8a75f5bb introduced a warning at fs/inode.c:692 unlock_new_inode(),
caused by unlock_new_inode() being called on existing inodes as well.

This patch changes setup_inode() to only call unlock_new_inode() for I_NEW
inodes.

Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/cramfs/inode.c

index a53b130b366c738c654a7ec71a3e4b01ee6d8ec7..1e7a33028d33908807d776d05840637cfd7e4f22 100644 (file)
@@ -80,7 +80,7 @@ static struct inode *get_cramfs_inode(struct super_block *sb,
                }
        } else {
                inode = iget_locked(sb, CRAMINO(cramfs_inode));
-               if (inode) {
+               if (inode && (inode->i_state & I_NEW)) {
                        setup_inode(inode, cramfs_inode);
                        unlock_new_inode(inode);
                }