ext4: avoid unnecessary stalls in ext4_evict_inode()
[sfrench/cifs-2.6.git] / fs / ext4 / inode.c
index d9733aa955e9d12fcd9d7492d4b6fb67d69f783c..754c2190af3148cd60f1d0a8006918ef3198937a 100644 (file)
@@ -215,7 +215,8 @@ void ext4_evict_inode(struct inode *inode)
                 */
                if (inode->i_ino != EXT4_JOURNAL_INO &&
                    ext4_should_journal_data(inode) &&
-                   (S_ISLNK(inode->i_mode) || S_ISREG(inode->i_mode))) {
+                   (S_ISLNK(inode->i_mode) || S_ISREG(inode->i_mode)) &&
+                   inode->i_data.nrpages) {
                        journal_t *journal = EXT4_SB(inode->i_sb)->s_journal;
                        tid_t commit_tid = EXT4_I(inode)->i_datasync_tid;