diff options
author | Joel Stanley <joel@jms.id.au> | 2018-11-27 08:23:56 +0300 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2018-11-27 08:24:09 +0300 |
commit | d608acfd4ac3fe17f3081bee8fcd4dcd896c2ffa (patch) | |
tree | ade4450a72a2e358a1d2e5cde321de0097fb291c /fs/udf/super.c | |
parent | 62ccc3924eff37012bd0c227d8b7dc71188fc358 (diff) | |
parent | a9da8725b7a744be3ff0ff44cab2547e4d1e6675 (diff) | |
download | linux-dev-4.18.tar.xz |
Merge tag 'v4.18.20' into dev-4.18dev-4.18
This is the 4.18.20 stable release
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r-- | fs/udf/super.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c index 74b13347cd94..e557d1317d0e 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -613,14 +613,11 @@ static int udf_remount_fs(struct super_block *sb, int *flags, char *options) struct udf_options uopt; struct udf_sb_info *sbi = UDF_SB(sb); int error = 0; - struct logicalVolIntegrityDescImpUse *lvidiu = udf_sb_lvidiu(sb); + + if (!(*flags & SB_RDONLY) && UDF_QUERY_FLAG(sb, UDF_FLAG_RW_INCOMPAT)) + return -EACCES; sync_filesystem(sb); - if (lvidiu) { - int write_rev = le16_to_cpu(lvidiu->minUDFWriteRev); - if (write_rev > UDF_MAX_WRITE_VERSION && !(*flags & SB_RDONLY)) - return -EACCES; - } uopt.flags = sbi->s_flags; uopt.uid = sbi->s_uid; @@ -1317,6 +1314,7 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block) ret = -EACCES; goto out_bh; } + UDF_SET_FLAG(sb, UDF_FLAG_RW_INCOMPAT); ret = udf_load_vat(sb, i, type1_idx); if (ret < 0) goto out_bh; @@ -2215,10 +2213,12 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) UDF_MAX_READ_VERSION); ret = -EINVAL; goto error_out; - } else if (minUDFWriteRev > UDF_MAX_WRITE_VERSION && - !sb_rdonly(sb)) { - ret = -EACCES; - goto error_out; + } else if (minUDFWriteRev > UDF_MAX_WRITE_VERSION) { + if (!sb_rdonly(sb)) { + ret = -EACCES; + goto error_out; + } + UDF_SET_FLAG(sb, UDF_FLAG_RW_INCOMPAT); } sbi->s_udfrev = minUDFWriteRev; @@ -2236,10 +2236,12 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) } if (sbi->s_partmaps[sbi->s_partition].s_partition_flags & - UDF_PART_FLAG_READ_ONLY && - !sb_rdonly(sb)) { - ret = -EACCES; - goto error_out; + UDF_PART_FLAG_READ_ONLY) { + if (!sb_rdonly(sb)) { + ret = -EACCES; + goto error_out; + } + UDF_SET_FLAG(sb, UDF_FLAG_RW_INCOMPAT); } if (udf_find_fileset(sb, &fileset, &rootdir)) { |