diff options
author | Jan Kara <jack@suse.cz> | 2014-09-04 18:26:19 +0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2014-09-04 23:37:40 +0400 |
commit | 470cca56c366428d4d5785a0a5a291619c332c7f (patch) | |
tree | 5b534bf2084b6021fcfb96fb92ec923bbd67442c /fs/udf/ialloc.c | |
parent | 4071b913622316970d0e1919f7d82b4403fec5f2 (diff) | |
download | linux-470cca56c366428d4d5785a0a5a291619c332c7f.tar.xz |
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: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/ialloc.c')
-rw-r--r-- | fs/udf/ialloc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index 6eaf5edf1ea1..647370d70175 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c @@ -95,6 +95,7 @@ struct inode *udf_new_inode(struct inode *dir, umode_t mode, int *err) lvidiu = udf_sb_lvidiu(sb); if (lvidiu) { iinfo->i_unique = lvid_get_unique_id(sb); + inode->i_generation = iinfo->i_unique; mutex_lock(&sbi->s_alloc_mutex); if (S_ISDIR(mode)) le32_add_cpu(&lvidiu->numDirs, 1); |