Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4065174pxv; Mon, 26 Jul 2021 20:18:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYPTapJIEKhLxrfj5rcF/7ygY5LHCqXdMM0OuzK3jQu1EJ/SnU6MjKjPqk6MbmypUyne2o X-Received: by 2002:a5d:9b9a:: with SMTP id r26mr17298833iom.34.1627355914894; Mon, 26 Jul 2021 20:18:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627355914; cv=none; d=google.com; s=arc-20160816; b=RG10U4XdB9K3xz7N7HkKamJjxhDc1kt0mkQbRs7k0ABWD0JiXvGl98XqDaRzTPO8H9 TlmQtc2/M/7L4RMANhks9pnYIBjQN9FpHK5cmczYgZQfa77PNjIDF/WfMvLiKS6Gr79C In0kZfovXHvhl3huupkke/qX1ku9gzD0RExm2dnonw/43boX2tGs0zN/LPiGEQbgMDne eD1zBw3adTW58O6W3ny636TI/+I9EoNDt+kL4RpJ4nPggM7EVroWnRnwNjJSyI4i/35f YJ4/kzQvGgg6jtT3HFmfjvhOYa6ns2C1laXI+Msjtb72YSkrg3E2qFrQslLuOXlrEQJq +jGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=9DGKRhToYS2sW34sjXCQyf23ZBP6PkgJdOwYDPEaT90=; b=S55vb2eef+Bhu6b452IuSzzijtccMNMk0awrx3CnuAxGuYseQ2/SZIdTTWSM9DmKf6 ycz69uUOwo4OW+mVawzAy7egx4Mu6laPAWesIUHZdbHN3VCpfZMdPNrreFD39ThecBWE K/nYppbs3ebIPijJEdyd8BoeKWCIH2SYaXF2XLveF/03wzfW+vg9X5XowFlqsPfbyamY KNZUAW3/WTuX7yYVl2jPxqS0A7ML28J88Jq+ef+SIUy3sE0JebjZjef/VpUieLxbRmCe oysGh4iBi6ZNNJSdfeRdRMBgSMzbIAMm5S2c/HXFSiq/Q/321XNdEU4ZYmbdfvfaIhds HVjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si1888656iok.60.2021.07.26.20.18.23; Mon, 26 Jul 2021 20:18:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234624AbhG0ChK (ORCPT + 99 others); Mon, 26 Jul 2021 22:37:10 -0400 Received: from mail-pj1-f52.google.com ([209.85.216.52]:43655 "EHLO mail-pj1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234513AbhG0ChJ (ORCPT ); Mon, 26 Jul 2021 22:37:09 -0400 Received: by mail-pj1-f52.google.com with SMTP id m2-20020a17090a71c2b0290175cf22899cso2947243pjs.2 for ; Mon, 26 Jul 2021 20:17:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9DGKRhToYS2sW34sjXCQyf23ZBP6PkgJdOwYDPEaT90=; b=pgt5Dk47liDqvxwRdwGkUt7DPq4XGFHW+5FV605rOr67x40EV58c0fF/GP515S1Eoo UKSZiALIuXRGo6OyEHreU32GmKaQjNJfLQ9zqDYiw4KYTMHWShrugU//mXD8Qyg2OjJk anRm9yS4Wq+MEO3i4McYuGMhmiTR0u2deKktekaZGEUqzrujcSMcaf3xFJZ/+BEKHcmI LCqTqLgMStjMsraFBDDvAG30wcwbxKRT2yhH3Y9iJq9Q9aZP8WtIDGRh5NPt3Aj8M2A1 GT5oOkvxNQ8FjkEES/JlZlQjDXtZ1upQIzVZQkj+1fRSllDWL9jbEEsULmctlBntoHbz cHtQ== X-Gm-Message-State: AOAM531Su3NrD323VJJJ9+6yOgI0l3eIjcay71aRJZkACmKKf3Q4vQvx a8KNggw5ss5a3sfDvD8cZBw= X-Received: by 2002:a17:90b:ed2:: with SMTP id gz18mr2065386pjb.184.1627355856153; Mon, 26 Jul 2021 20:17:36 -0700 (PDT) Received: from ?IPv6:2601:647:4000:d7:d009:b5bd:a16e:1de3? ([2601:647:4000:d7:d009:b5bd:a16e:1de3]) by smtp.gmail.com with ESMTPSA id l10sm1038263pjg.11.2021.07.26.20.17.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Jul 2021 20:17:35 -0700 (PDT) Subject: Re: [PATCH 2/4] configfs: Fix writing at a non-zero offset To: Bodo Stroesser , Christoph Hellwig Cc: Joel Becker , linux-kernel@vger.kernel.org, "Martin K . Petersen" , Yanko Kaneti , Brendan Higgins References: <20210723212353.896343-1-bvanassche@acm.org> <20210723212353.896343-3-bvanassche@acm.org> <7bee65ce-f5f1-a525-c72d-221b5d23cf3e@gmail.com> <4055ca70-7669-d00d-7c08-86fe75a3d377@gmail.com> <618b2bdc-282b-0a1d-1fc5-020cf80d7a7e@acm.org> From: Bart Van Assche Message-ID: Date: Mon, 26 Jul 2021 20:17:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Bart.