diff options
Diffstat (limited to 'fs/inode.c')
-rw-r--r-- | fs/inode.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/inode.c b/fs/inode.c index 00d5fc3b86e..d6dfb09c828 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -333,8 +333,10 @@ EXPORT_SYMBOL(set_nlink); */ void inc_nlink(struct inode *inode) { - if (WARN_ON(inode->i_nlink == 0)) + if (unlikely(inode->i_nlink == 0)) { + WARN_ON(!(inode->i_state & I_LINKABLE)); atomic_long_dec(&inode->i_sb->s_remove_count); + } inode->__i_nlink++; } |