File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -5053,22 +5053,29 @@ static int statmount_string(struct kstatmount *s, u64 flag)
5053
5053
size_t kbufsize ;
5054
5054
struct seq_file * seq = & s -> seq ;
5055
5055
struct statmount * sm = & s -> sm ;
5056
+ u32 start , * offp ;
5057
+
5058
+ /* Reserve an empty string at the beginning for any unset offsets */
5059
+ if (!seq -> count )
5060
+ seq_putc (seq , 0 );
5061
+
5062
+ start = seq -> count ;
5056
5063
5057
5064
switch (flag ) {
5058
5065
case STATMOUNT_FS_TYPE :
5059
- sm -> fs_type = seq -> count ;
5066
+ offp = & sm -> fs_type ;
5060
5067
ret = statmount_fs_type (s , seq );
5061
5068
break ;
5062
5069
case STATMOUNT_MNT_ROOT :
5063
- sm -> mnt_root = seq -> count ;
5070
+ offp = & sm -> mnt_root ;
5064
5071
ret = statmount_mnt_root (s , seq );
5065
5072
break ;
5066
5073
case STATMOUNT_MNT_POINT :
5067
- sm -> mnt_point = seq -> count ;
5074
+ offp = & sm -> mnt_point ;
5068
5075
ret = statmount_mnt_point (s , seq );
5069
5076
break ;
5070
5077
case STATMOUNT_MNT_OPTS :
5071
- sm -> mnt_opts = seq -> count ;
5078
+ offp = & sm -> mnt_opts ;
5072
5079
ret = statmount_mnt_opts (s , seq );
5073
5080
break ;
5074
5081
default :
@@ -5090,6 +5097,7 @@ static int statmount_string(struct kstatmount *s, u64 flag)
5090
5097
5091
5098
seq -> buf [seq -> count ++ ] = '\0' ;
5092
5099
sm -> mask |= flag ;
5100
+ * offp = start ;
5093
5101
return 0 ;
5094
5102
}
5095
5103
You can’t perform that action at this time.
0 commit comments