diff options
Diffstat (limited to 'fs/isofs/inode.c')
-rw-r--r-- | fs/isofs/inode.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 875d37fb6c70..044a254d526b 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c | |||
@@ -110,6 +110,7 @@ static const struct super_operations isofs_sops = { | |||
110 | .put_super = isofs_put_super, | 110 | .put_super = isofs_put_super, |
111 | .statfs = isofs_statfs, | 111 | .statfs = isofs_statfs, |
112 | .remount_fs = isofs_remount, | 112 | .remount_fs = isofs_remount, |
113 | .show_options = generic_show_options, | ||
113 | }; | 114 | }; |
114 | 115 | ||
115 | 116 | ||
@@ -144,7 +145,8 @@ struct iso9660_options{ | |||
144 | char nocompress; | 145 | char nocompress; |
145 | unsigned char check; | 146 | unsigned char check; |
146 | unsigned int blocksize; | 147 | unsigned int blocksize; |
147 | mode_t mode; | 148 | mode_t fmode; |
149 | mode_t dmode; | ||
148 | gid_t gid; | 150 | gid_t gid; |
149 | uid_t uid; | 151 | uid_t uid; |
150 | char *iocharset; | 152 | char *iocharset; |
@@ -305,7 +307,7 @@ enum { | |||
305 | Opt_block, Opt_check_r, Opt_check_s, Opt_cruft, Opt_gid, Opt_ignore, | 307 | Opt_block, Opt_check_r, Opt_check_s, Opt_cruft, Opt_gid, Opt_ignore, |
306 | Opt_iocharset, Opt_map_a, Opt_map_n, Opt_map_o, Opt_mode, Opt_nojoliet, | 308 | Opt_iocharset, Opt_map_a, Opt_map_n, Opt_map_o, Opt_mode, Opt_nojoliet, |
307 | Opt_norock, Opt_sb, Opt_session, Opt_uid, Opt_unhide, Opt_utf8, Opt_err, | 309 | Opt_norock, Opt_sb, Opt_session, Opt_uid, Opt_unhide, Opt_utf8, Opt_err, |
308 | Opt_nocompress, Opt_hide, Opt_showassoc, | 310 | Opt_nocompress, Opt_hide, Opt_showassoc, Opt_dmode, |
309 | }; | 311 | }; |
310 | 312 | ||
311 | static match_table_t tokens = { | 313 | static match_table_t tokens = { |
@@ -332,6 +334,7 @@ static match_table_t tokens = { | |||
332 | {Opt_uid, "uid=%u"}, | 334 | {Opt_uid, "uid=%u"}, |
333 | {Opt_gid, "gid=%u"}, | 335 | {Opt_gid, "gid=%u"}, |
334 | {Opt_mode, "mode=%u"}, | 336 | {Opt_mode, "mode=%u"}, |
337 | {Opt_dmode, "dmode=%u"}, | ||
335 | {Opt_block, "block=%u"}, | 338 | {Opt_block, "block=%u"}, |
336 | {Opt_ignore, "conv=binary"}, | 339 | {Opt_ignore, "conv=binary"}, |
337 | {Opt_ignore, "conv=b"}, | 340 | {Opt_ignore, "conv=b"}, |
@@ -359,7 +362,7 @@ static int parse_options(char *options, struct iso9660_options *popt) | |||
359 | popt->check = 'u'; /* unset */ | 362 | popt->check = 'u'; /* unset */ |
360 | popt->nocompress = 0; | 363 | popt->nocompress = 0; |
361 | popt->blocksize = 1024; | 364 | popt->blocksize = 1024; |
362 | popt->mode = S_IRUGO | S_IXUGO; /* | 365 | popt->fmode = popt->dmode = S_IRUGO | S_IXUGO; /* |
363 | * r-x for all. The disc could | 366 | * r-x for all. The disc could |
364 | * be shared with DOS machines so | 367 | * be shared with DOS machines so |
365 | * virtually anything could be | 368 | * virtually anything could be |
@@ -451,7 +454,12 @@ static int parse_options(char *options, struct iso9660_options *popt) | |||
451 | case Opt_mode: | 454 | case Opt_mode: |
452 | if (match_int(&args[0], &option)) | 455 | if (match_int(&args[0], &option)) |
453 | return 0; | 456 | return 0; |
454 | popt->mode = option; | 457 | popt->fmode = option; |
458 | break; | ||
459 | case Opt_dmode: | ||
460 | if (match_int(&args[0], &option)) | ||
461 | return 0; | ||
462 | popt->dmode = option; | ||
455 | break; | 463 | break; |
456 | case Opt_block: | 464 | case Opt_block: |
457 | if (match_int(&args[0], &option)) | 465 | if (match_int(&args[0], &option)) |
@@ -554,6 +562,8 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent) | |||
554 | int table, error = -EINVAL; | 562 | int table, error = -EINVAL; |
555 | unsigned int vol_desc_start; | 563 | unsigned int vol_desc_start; |
556 | 564 | ||
565 | save_mount_options(s, data); | ||
566 | |||
557 | sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); | 567 | sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); |
558 | if (!sbi) | 568 | if (!sbi) |
559 | return -ENOMEM; | 569 | return -ENOMEM; |
@@ -801,7 +811,8 @@ root_found: | |||
801 | * on the disk as suid, so we merely allow them to set the default | 811 | * on the disk as suid, so we merely allow them to set the default |
802 | * permissions. | 812 | * permissions. |
803 | */ | 813 | */ |
804 | sbi->s_mode = opt.mode & 0777; | 814 | sbi->s_fmode = opt.fmode & 0777; |
815 | sbi->s_dmode = opt.dmode & 0777; | ||
805 | 816 | ||
806 | /* | 817 | /* |
807 | * Read the root inode, which _may_ result in changing | 818 | * Read the root inode, which _may_ result in changing |
@@ -1248,7 +1259,7 @@ static int isofs_read_inode(struct inode *inode) | |||
1248 | ei->i_file_format = isofs_file_normal; | 1259 | ei->i_file_format = isofs_file_normal; |
1249 | 1260 | ||
1250 | if (de->flags[-high_sierra] & 2) { | 1261 | if (de->flags[-high_sierra] & 2) { |
1251 | inode->i_mode = S_IRUGO | S_IXUGO | S_IFDIR; | 1262 | inode->i_mode = sbi->s_dmode | S_IFDIR; |
1252 | inode->i_nlink = 1; /* | 1263 | inode->i_nlink = 1; /* |
1253 | * Set to 1. We know there are 2, but | 1264 | * Set to 1. We know there are 2, but |
1254 | * the find utility tries to optimize | 1265 | * the find utility tries to optimize |
@@ -1258,9 +1269,8 @@ static int isofs_read_inode(struct inode *inode) | |||
1258 | */ | 1269 | */ |
1259 | } else { | 1270 | } else { |
1260 | /* Everybody gets to read the file. */ | 1271 | /* Everybody gets to read the file. */ |
1261 | inode->i_mode = sbi->s_mode; | 1272 | inode->i_mode = sbi->s_fmode | S_IFREG; |
1262 | inode->i_nlink = 1; | 1273 | inode->i_nlink = 1; |
1263 | inode->i_mode |= S_IFREG; | ||
1264 | } | 1274 | } |
1265 | inode->i_uid = sbi->s_uid; | 1275 | inode->i_uid = sbi->s_uid; |
1266 | inode->i_gid = sbi->s_gid; | 1276 | inode->i_gid = sbi->s_gid; |