[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d0a24bff-714a-4709-9a64-f4b508a1c231@huawei.com>
Date: Tue, 21 Jan 2025 20:20:47 +0800
From: Baokun Li <libaokun1@...wei.com>
To: Jan Kara <jack@...e.cz>
CC: <linux-ext4@...r.kernel.org>, <tytso@....edu>, <adilger.kernel@...ger.ca>,
<linux-kernel@...r.kernel.org>, <yi.zhang@...wei.com>,
<yangerkun@...wei.com>, Baokun Li <libaokun1@...wei.com>, Baokun Li
<libaokun@...weicloud.com>
Subject: Re: [PATCH 2/7] ext4: add EXT4_FLAGS_EMERGENCY_RO bit
On 2025/1/21 20:08, Jan Kara wrote:
> On Fri 17-01-25 16:23:10, libaokun@...weicloud.com wrote:
>> From: Baokun Li <libaokun1@...wei.com>
>>
>> EXT4_FLAGS_EMERGENCY_RO Indicates that the current file system has become
>> read-only due to some error. Compared to SB_RDONLY, setting it does not
>> require a lock because we won't clear it, which avoids over-coupling with
>> vfs freeze. Also, add a helper function ext4_emergency_ro() to check if
>> the bit is set.
>>
>> Signed-off-by: Baokun Li <libaokun1@...wei.com>
> The same comment about comma after the last enum member. Otherwise looks
> good. Feel free to add:
>
> Reviewed-by: Jan Kara <jack@...e.cz>
>
> Honza
Okay, I'm going to add a comma here in the next version as well.
Thank you for your review!
Regards,
Baokun
>> ---
>> fs/ext4/ext4.h | 8 +++++++-
>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
>> index 612208527512..c5b775482897 100644
>> --- a/fs/ext4/ext4.h
>> +++ b/fs/ext4/ext4.h
>> @@ -2235,7 +2235,8 @@ extern int ext4_feature_set_ok(struct super_block *sb, int readonly);
>> enum {
>> EXT4_FLAGS_RESIZING, /* Avoid superblock update and resize race */
>> EXT4_FLAGS_SHUTDOWN, /* Prevent access to the file system */
>> - EXT4_FLAGS_BDEV_IS_DAX /* Current block device support DAX */
>> + EXT4_FLAGS_BDEV_IS_DAX, /* Current block device support DAX */
>> + EXT4_FLAGS_EMERGENCY_RO /* Emergency read-only due to fs errors */
>> };
>>
>> static inline int ext4_forced_shutdown(struct super_block *sb)
>> @@ -2243,6 +2244,11 @@ static inline int ext4_forced_shutdown(struct super_block *sb)
>> return test_bit(EXT4_FLAGS_SHUTDOWN, &EXT4_SB(sb)->s_ext4_flags);
>> }
>>
>> +static inline int ext4_emergency_ro(struct super_block *sb)
>> +{
>> + return test_bit(EXT4_FLAGS_EMERGENCY_RO, &EXT4_SB(sb)->s_ext4_flags);
>> +}
>> +
>> /*
>> * Default values for user and/or group using reserved blocks
>> */
>> --
>> 2.39.2
>>
Powered by blists - more mailing lists