Commit 470cca56 authored by Jan Kara's avatar Jan Kara

udf: Set i_generation field

Currently UDF doesn't initialize i_generation in any way and thus NFS
can easily get reallocated inodes from stale file handles. Luckily UDF
already has a unique object identifier associated with each inode -
i_unique. Use that for initialization of i_generation.
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 4071b913
...@@ -95,6 +95,7 @@ struct inode *udf_new_inode(struct inode *dir, umode_t mode, int *err) ...@@ -95,6 +95,7 @@ struct inode *udf_new_inode(struct inode *dir, umode_t mode, int *err)
lvidiu = udf_sb_lvidiu(sb); lvidiu = udf_sb_lvidiu(sb);
if (lvidiu) { if (lvidiu) {
iinfo->i_unique = lvid_get_unique_id(sb); iinfo->i_unique = lvid_get_unique_id(sb);
inode->i_generation = iinfo->i_unique;
mutex_lock(&sbi->s_alloc_mutex); mutex_lock(&sbi->s_alloc_mutex);
if (S_ISDIR(mode)) if (S_ISDIR(mode))
le32_add_cpu(&lvidiu->numDirs, 1); le32_add_cpu(&lvidiu->numDirs, 1);
......
...@@ -1484,6 +1484,7 @@ static int udf_read_inode(struct inode *inode) ...@@ -1484,6 +1484,7 @@ static int udf_read_inode(struct inode *inode)
iinfo->i_lenAlloc = le32_to_cpu(efe->lengthAllocDescs); iinfo->i_lenAlloc = le32_to_cpu(efe->lengthAllocDescs);
iinfo->i_checkpoint = le32_to_cpu(efe->checkpoint); iinfo->i_checkpoint = le32_to_cpu(efe->checkpoint);
} }
inode->i_generation = iinfo->i_unique;
switch (fe->icbTag.fileType) { switch (fe->icbTag.fileType) {
case ICBTAG_FILE_TYPE_DIRECTORY: case ICBTAG_FILE_TYPE_DIRECTORY:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment