diff options
Diffstat (limited to 'fs/nilfs2/inode.c')
-rw-r--r-- | fs/nilfs2/inode.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index a1922b17662c..49ab4a49bb4f 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c | |||
@@ -306,7 +306,6 @@ struct inode *nilfs_new_inode(struct inode *dir, int mode) | |||
306 | 306 | ||
307 | /* ii->i_file_acl = 0; */ | 307 | /* ii->i_file_acl = 0; */ |
308 | /* ii->i_dir_acl = 0; */ | 308 | /* ii->i_dir_acl = 0; */ |
309 | ii->i_dtime = 0; | ||
310 | ii->i_dir_start_lookup = 0; | 309 | ii->i_dir_start_lookup = 0; |
311 | #ifdef CONFIG_NILFS_FS_POSIX_ACL | 310 | #ifdef CONFIG_NILFS_FS_POSIX_ACL |
312 | ii->i_acl = NULL; | 311 | ii->i_acl = NULL; |
@@ -390,11 +389,10 @@ int nilfs_read_inode_common(struct inode *inode, | |||
390 | inode->i_atime.tv_sec = le64_to_cpu(raw_inode->i_mtime); | 389 | inode->i_atime.tv_sec = le64_to_cpu(raw_inode->i_mtime); |
391 | inode->i_ctime.tv_sec = le64_to_cpu(raw_inode->i_ctime); | 390 | inode->i_ctime.tv_sec = le64_to_cpu(raw_inode->i_ctime); |
392 | inode->i_mtime.tv_sec = le64_to_cpu(raw_inode->i_mtime); | 391 | inode->i_mtime.tv_sec = le64_to_cpu(raw_inode->i_mtime); |
393 | inode->i_atime.tv_nsec = 0; | 392 | inode->i_atime.tv_nsec = le32_to_cpu(raw_inode->i_mtime_nsec); |
394 | inode->i_ctime.tv_nsec = 0; | 393 | inode->i_ctime.tv_nsec = le32_to_cpu(raw_inode->i_ctime_nsec); |
395 | inode->i_mtime.tv_nsec = 0; | 394 | inode->i_mtime.tv_nsec = le32_to_cpu(raw_inode->i_mtime_nsec); |
396 | ii->i_dtime = le64_to_cpu(raw_inode->i_dtime); | 395 | if (inode->i_nlink == 0 && inode->i_mode == 0) |
397 | if (inode->i_nlink == 0 && (inode->i_mode == 0 || ii->i_dtime)) | ||
398 | return -EINVAL; /* this inode is deleted */ | 396 | return -EINVAL; /* this inode is deleted */ |
399 | 397 | ||
400 | inode->i_blocks = le64_to_cpu(raw_inode->i_blocks); | 398 | inode->i_blocks = le64_to_cpu(raw_inode->i_blocks); |
@@ -505,9 +503,10 @@ void nilfs_write_inode_common(struct inode *inode, | |||
505 | raw_inode->i_size = cpu_to_le64(inode->i_size); | 503 | raw_inode->i_size = cpu_to_le64(inode->i_size); |
506 | raw_inode->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); | 504 | raw_inode->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); |
507 | raw_inode->i_mtime = cpu_to_le64(inode->i_mtime.tv_sec); | 505 | raw_inode->i_mtime = cpu_to_le64(inode->i_mtime.tv_sec); |
506 | raw_inode->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); | ||
507 | raw_inode->i_mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); | ||
508 | raw_inode->i_blocks = cpu_to_le64(inode->i_blocks); | 508 | raw_inode->i_blocks = cpu_to_le64(inode->i_blocks); |
509 | 509 | ||
510 | raw_inode->i_dtime = cpu_to_le64(ii->i_dtime); | ||
511 | raw_inode->i_flags = cpu_to_le32(ii->i_flags); | 510 | raw_inode->i_flags = cpu_to_le32(ii->i_flags); |
512 | raw_inode->i_generation = cpu_to_le32(inode->i_generation); | 511 | raw_inode->i_generation = cpu_to_le32(inode->i_generation); |
513 | 512 | ||