rk: revert to v3.10
[firefly-linux-kernel-4.4.55.git] / fs / isofs / inode.c
index 10489bbd40fc5479d4a5ea366e2d849d1e74475a..d9b8aebdeb22b467eb9717996b823734f8446300 100644 (file)
@@ -69,7 +69,7 @@ static void isofs_put_super(struct super_block *sb)
        return;
 }
 
-static int isofs_read_inode(struct inode *, int relocated);
+static int isofs_read_inode(struct inode *);
 static int isofs_statfs (struct dentry *, struct kstatfs *);
 
 static struct kmem_cache *isofs_inode_cachep;
@@ -125,8 +125,8 @@ static void destroy_inodecache(void)
 
 static int isofs_remount(struct super_block *sb, int *flags, char *data)
 {
-       if (!(*flags & MS_RDONLY))
-               return -EROFS;
+       /* we probably want a lot more here */
+       *flags |= MS_RDONLY;
        return 0;
 }
 
@@ -779,6 +779,15 @@ root_found:
         */
        s->s_maxbytes = 0x80000000000LL;
 
+       /*
+        * The CDROM is read-only, has no nodes (devices) on it, and since
+        * all of the files appear to be owned by root, we really do not want
+        * to allow suid.  (suid or devices will not show up unless we have
+        * Rock Ridge extensions)
+        */
+
+       s->s_flags |= MS_RDONLY /* | MS_NODEV | MS_NOSUID */;
+
        /* Set this for reference. Its not currently used except on write
           which we don't have .. */
 
@@ -1274,7 +1283,7 @@ out_toomany:
        goto out;
 }
 
-static int isofs_read_inode(struct inode *inode, int relocated)
+static int isofs_read_inode(struct inode *inode)
 {
        struct super_block *sb = inode->i_sb;
        struct isofs_sb_info *sbi = ISOFS_SB(sb);
@@ -1419,7 +1428,7 @@ static int isofs_read_inode(struct inode *inode, int relocated)
         */
 
        if (!high_sierra) {
-               parse_rock_ridge_inode(de, inode, relocated);
+               parse_rock_ridge_inode(de, inode);
                /* if we want uid/gid set, override the rock ridge setting */
                if (sbi->s_uid_set)
                        inode->i_uid = sbi->s_uid;
@@ -1498,10 +1507,9 @@ static int isofs_iget5_set(struct inode *ino, void *data)
  * offset that point to the underlying meta-data for the inode.  The
  * code below is otherwise similar to the iget() code in
  * include/linux/fs.h */
-struct inode *__isofs_iget(struct super_block *sb,
-                          unsigned long block,
-                          unsigned long offset,
-                          int relocated)
+struct inode *isofs_iget(struct super_block *sb,
+                        unsigned long block,
+                        unsigned long offset)
 {
        unsigned long hashval;
        struct inode *inode;
@@ -1523,7 +1531,7 @@ struct inode *__isofs_iget(struct super_block *sb,
                return ERR_PTR(-ENOMEM);
 
        if (inode->i_state & I_NEW) {
-               ret = isofs_read_inode(inode, relocated);
+               ret = isofs_read_inode(inode);
                if (ret < 0) {
                        iget_failed(inode);
                        inode = ERR_PTR(ret);
@@ -1538,9 +1546,6 @@ struct inode *__isofs_iget(struct super_block *sb,
 static struct dentry *isofs_mount(struct file_system_type *fs_type,
        int flags, const char *dev_name, void *data)
 {
-       /* We don't support read-write mounts */
-       if (!(flags & MS_RDONLY))
-               return ERR_PTR(-EACCES);
        return mount_bdev(fs_type, flags, dev_name, data, isofs_fill_super);
 }