diff options
-rw-r--r-- | fs/udf/inode.c | 2 | ||||
-rw-r--r-- | fs/udf/namei.c | 19 |
2 files changed, 11 insertions, 10 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index f792681f2f73..24cfa55d0fdc 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c | |||
@@ -289,7 +289,7 @@ struct buffer_head *udf_expand_dir_adinicb(struct inode *inode, int *block, | |||
289 | eloc.logicalBlockNum = *block; | 289 | eloc.logicalBlockNum = *block; |
290 | eloc.partitionReferenceNum = | 290 | eloc.partitionReferenceNum = |
291 | iinfo->i_location.partitionReferenceNum; | 291 | iinfo->i_location.partitionReferenceNum; |
292 | elen = inode->i_size; | 292 | elen = inode->i_sb->s_blocksize; |
293 | iinfo->i_lenExtents = elen; | 293 | iinfo->i_lenExtents = elen; |
294 | epos.bh = NULL; | 294 | epos.bh = NULL; |
295 | epos.block = iinfo->i_location; | 295 | epos.block = iinfo->i_location; |
diff --git a/fs/udf/namei.c b/fs/udf/namei.c index dacd8f4cea8a..112a5fb0b27b 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c | |||
@@ -395,7 +395,6 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir, | |||
395 | } | 395 | } |
396 | 396 | ||
397 | block = dinfo->i_location.logicalBlockNum; | 397 | block = dinfo->i_location.logicalBlockNum; |
398 | |||
399 | } else { | 398 | } else { |
400 | block = udf_get_lb_pblock(dir->i_sb, dinfo->i_location, 0); | 399 | block = udf_get_lb_pblock(dir->i_sb, dinfo->i_location, 0); |
401 | fibh->sbh = fibh->ebh = NULL; | 400 | fibh->sbh = fibh->ebh = NULL; |
@@ -474,6 +473,14 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir, | |||
474 | } | 473 | } |
475 | 474 | ||
476 | add: | 475 | add: |
476 | if (dinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) { | ||
477 | elen = (elen + sb->s_blocksize - 1) & ~(sb->s_blocksize - 1); | ||
478 | if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT) | ||
479 | epos.offset -= sizeof(short_ad); | ||
480 | else if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG) | ||
481 | epos.offset -= sizeof(long_ad); | ||
482 | udf_write_aext(dir, &epos, eloc, elen, 1); | ||
483 | } | ||
477 | f_pos += nfidlen; | 484 | f_pos += nfidlen; |
478 | 485 | ||
479 | if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB && | 486 | if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB && |
@@ -491,15 +498,9 @@ add: | |||
491 | if (!fibh->sbh) | 498 | if (!fibh->sbh) |
492 | return NULL; | 499 | return NULL; |
493 | epos.block = dinfo->i_location; | 500 | epos.block = dinfo->i_location; |
494 | eloc.logicalBlockNum = block; | ||
495 | eloc.partitionReferenceNum = | ||
496 | dinfo->i_location.partitionReferenceNum; | ||
497 | elen = dir->i_sb->s_blocksize; | ||
498 | epos.offset = udf_file_entry_alloc_offset(dir); | 501 | epos.offset = udf_file_entry_alloc_offset(dir); |
499 | if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT) | 502 | /* Load extent udf_expand_dir_adinicb() has created */ |
500 | epos.offset += sizeof(short_ad); | 503 | udf_current_aext(dir, &epos, &eloc, &elen, 1); |
501 | else if (dinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG) | ||
502 | epos.offset += sizeof(long_ad); | ||
503 | } | 504 | } |
504 | 505 | ||
505 | if (sb->s_blocksize - fibh->eoffset >= nfidlen) { | 506 | if (sb->s_blocksize - fibh->eoffset >= nfidlen) { |