Re: [PATCH] qnx4: convert qnx4 to use the new mount api

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/27/24 6:26 AM, Christian Brauner wrote:
> On Mon, Feb 26, 2024 at 04:46:28PM -0600, Bill O'Donnell wrote:
>> Convert the qnx4 filesystem to use the new mount API.
>>
>> Tested mount, umount, and remount using a qnx4 boot image.
>>
>> Signed-off-by: Bill O'Donnell <bodonnel@xxxxxxxxxx>
>> ---
>>  fs/qnx4/inode.c | 49 +++++++++++++++++++++++++++++++------------------
>>  1 file changed, 31 insertions(+), 18 deletions(-)
>>
>> diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c
>> index 6eb9bb369b57..c36fbe45a0e9 100644
>> --- a/fs/qnx4/inode.c
>> +++ b/fs/qnx4/inode.c
>> @@ -21,6 +21,7 @@
>>  #include <linux/buffer_head.h>
>>  #include <linux/writeback.h>
>>  #include <linux/statfs.h>
>> +#include <linux/fs_context.h>
>>  #include "qnx4.h"
>>  
>>  #define QNX4_VERSION  4
>> @@ -30,28 +31,33 @@ static const struct super_operations qnx4_sops;
>>  
>>  static struct inode *qnx4_alloc_inode(struct super_block *sb);
>>  static void qnx4_free_inode(struct inode *inode);
>> -static int qnx4_remount(struct super_block *sb, int *flags, char *data);
>>  static int qnx4_statfs(struct dentry *, struct kstatfs *);
>> +static int qnx4_get_tree(struct fs_context *fc);
>>  
>>  static const struct super_operations qnx4_sops =
>>  {
>>  	.alloc_inode	= qnx4_alloc_inode,
>>  	.free_inode	= qnx4_free_inode,
>>  	.statfs		= qnx4_statfs,
>> -	.remount_fs	= qnx4_remount,
>>  };
>>  
>> -static int qnx4_remount(struct super_block *sb, int *flags, char *data)
>> +static int qnx4_reconfigure(struct fs_context *fc)
>>  {
>> -	struct qnx4_sb_info *qs;
>> +	struct super_block *sb = fc->root->d_sb;
>> +	struct qnx4_sb_info *qs = sb->s_fs_info;
>>  
>>  	sync_filesystem(sb);
>>  	qs = qnx4_sb(sb);
>>  	qs->Version = QNX4_VERSION;
>> -	*flags |= SB_RDONLY;
>> +	fc->sb_flags |= SB_RDONLY;
> 
> This confused me to no end because setting SB_RDONLY here
> unconditionally would be wrong if it's not requested from userspace
> during a remount. Because in that case the vfs wouldn't know that an
> actual read-only remount request had been made which means that we don't
> take the necessary protection steps to transition from read-write to
> read-only. But qnx{4,6} are read-only so this is actually correct even
> though it seems pretty weird.

This seems to be how every only-read-only filesystem does it,
see erofs, romfs, squashfs, cramfs ...

-Eric





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux