Yes, maybe.Also, rename ERR_MEDIUM to MED_FAILURE.I think that MEDIA_FAILURE looks better.
I think so too.
If so, should I change VOL_DIRTY to VOLUME_DIRTY?
- p_boot->vol_flags = cpu_to_le16(new_flag);How about set or clear only dirty bit to on-disk volume flags instead
+ p_boot->vol_flags = cpu_to_le16(new_flags);
of using
sbi->vol_flags_noclear ?
if (set)
p_boot->vol_flags |= cpu_to_le16(VOL_DIRTY);
else
p_boot->vol_flags &= cpu_to_le16(~VOL_DIRTY);
In this way, the initial VOL_DIRTY cannot be retained.I know what you do. I mean this function does not need to be called if volume dirty
The purpose of this patch is to avoid losing the initial VOL_DIRTY and MED_FAILURE.
Furthermore, I'm also thinking of setting MED_FAILURE.
Is already set on on-disk volume flags as I said earlier.
However, the formula for 'new_flags' may be a bit complicated.It looks complicated. It would be better to simply set/clear VOLUME DIRTY bit.
Is it better to change to the following?
if (new_flags == VOL_CLEAN)
new_flags = sbi->vol_flags & ~VOL_DIRTY
else
new_flags |= sbi->vol_flags;
new_flags |= sbi->vol_flags_noclear;
one more point,
Is there a better name than 'vol_flags_noclear'?
(I can't come up with a good name anymore)