[lkml]   [2021]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/4] configfs: Fix writing at a non-zero offset
On 7/26/21 5:54 PM, Bodo Stroesser wrote:
> The new behavior can also cause trouble with existing store handlers.
> Example:
> The tcmu attribute files cmd_time_out and qfull_time_out just take a
> string containing the decimal formatted number of seconds of the
> timeout. Each number up to now had to be transferred in a single write.
> Assume the old value is 30 and we want to change to 19. If userspace
> writes byte by byte, you end up calling
> store(item, "1\0", 1) and then
> store(item, "19\9", 2).
> If these quick changes do not cause trouble in tcmu's scsi cmd handling,
> then think what happens, if userspace is interrupted between the two
> writes. Allowing to split the writes cause a loss of "atomicity".

From Documentation/filesystems/configfs.rst, for normal attributes:
"Configfs expects write(2) to store the entire buffer at once." In other
words, the behavior for partial writes is undocumented. My changes
preserve the behavior if a buffer is written in its entirety. I do not
agree that my changes can cause trouble for existing store handlers.


 \ /
  Last update: 2021-07-27 05:18    [W:0.099 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site