From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=117.135.210.4 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796010568; b=zOJroSVQHiyDYDVuBJrN8XLzdDqUEw8ZZOuHanf+dSfQP0JxN2Huw+QB9POKkXVmxZ9L KUUi8/ADWycn5CbI3DAzlCAE+hHhvNDXhE3lp1ePRPKoPizvNSjUybzwLhfYaWSOeF4I1 eLRgEdd8O5XyeOdQyUUqPKAu3tgmPy8mWq1ZM6Y29vu7NMMD7xVzu7Fy9ydUme2TL2jtD 7sk4Ez5JgArHmdVho2zV0UWXU8LjhVbI5B4tAq5kIA3/vDpuJi1L84TxPgkNVuPF5MluK 6cHa6wHbRNqfCbkFOoIK9fb09mjeIO40N5BmIl4qFR2I1Ar4zNepOkkDzsaDtWXDNRA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796010568; h=DMARC-Filter:DKIM-Signature:Received:Message-ID:Date:MIME-Version: User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-CM-TRANSID: X-Coremail-Antispam:X-Originating-IP:X-CM-SenderInfo; bh=AS8rHTYB4QC3JuR+2tYU/WFz1gG1lv7qfuXBBRBkCLI=; b=rk1boU57FxAdpkUwnqm/xcOKAil5cMmhZDWAnjh4u9kUl7XrTR15CMUn0HIaECu+sMLl f526Qkwju5djcvaXcsho7iUlxdRpr/fa9mVRWFLtOFhx8azXTbG60hBh404Txslfc19wk QVe8Q2B1GvIkpv8XtCyq16R3hgj1p3GncTVX7o+csLmNSK8gx+Sf+nNlVyCJQ3CRefCjf sl6usYUycIgY61eKLnVo0esw1FY1jWULr7FvgsrVcacDvAiOGdz9oEBGtO1l/2U2SM34q SI5OUP4EcyLjFMpFXODVdFCkgCCHpHaKPPlNXX/ZC4mbFfJiSOvJ/YSjaBfHWznYqrQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b="gdQntC/f"; arc=none smtp.remote-ip=117.135.210.4 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCFA9606A327 for ; Mon, 30 Nov 2026 03:49:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CCFA9606A327 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=gdQntC/f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Message-ID:Date:MIME-Version:Subject:To:From: Content-Type; bh=AS8rHTYB4QC3JuR+2tYU/WFz1gG1lv7qfuXBBRBkCLI=; b=gdQntC/fCFd8gn5STqNFDR1TlDUF3zxSm48+d7bWNktdSAwCbDKCGcYcCbXyo2 6/rAV4StbZZeLOzs13oyIE+Ga3Eo/Ysjm8BJK4fD9gPJuQGjibVRyreWPNJveKII zt1xhnB63WrbT3/AuZGOcVSgfnT0/Ru3Tup/eMXdyhBKs= Received: from [IPV6:2409:8900:6ae:3295:bdf5:7149:7d26:d2ca] (unknown []) by gzga-smtp-mtada-g1-1 (Coremail) with SMTP id _____wD3H3gv8gxrmAgUKw--.44548S2; Mon, 30 Nov 2026 11:49:04 +0800 (CST) Message-ID: <615143b6-da2b-4d8e-b974-653024d59360@163.com> Date: Mon, 30 Nov 2026 11:49:03 +0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/6] ntfs: mark the record dirtied by a resident write at iomap begin To: Hongling Zeng , linkinjeon@kernel.org, hyc.lee@gmail.com Cc: ntfs@lists.linux.dev, linux-kernel@vger.kernel.org, Baolin Liu References: <20261130030708.59798-1-zenghongling@kylinos.cn> <20261130030708.59798-2-zenghongling@kylinos.cn> Content-Language: en-US From: liubaolin In-Reply-To: <20261130030708.59798-2-zenghongling@kylinos.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID:_____wD3H3gv8gxrmAgUKw--.44548S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7AF4DXr4fZFyfWr4UXryrWFg_yoW8Zw1kpF Zak3W7Gr4qvw1Uuan7KF4jqFyF9rWfGw4UXr15tF45ZayFq392gFn2gF1Fvw1Sk3s3JayF vr4q93y5W34UZFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07j55r7UUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbC6RCmcWsM8jCtwgAA3k 在 2026/11/30 11:07, Hongling Zeng 写道: > A buffered write to a resident attribute is copied straight into the > mft record found by the search in ntfs_write_iomap_begin_resident(). > With an attribute list that record can be an extent record, while > ntfs_write_iomap_end_resident() only marks the base inode dirty, so > the record holding the copied data is never written out and the write > is lost on a clean unmount. > > Mark the record the lookup found at begin time, while the search > context still points at it. This is safe against a concurrent > writeback of the record: extent records are only written out from the > write_inode path of the base inode, which takes the same mrec_lock > the write path holds until iomap_end. > > Keep marking the base record in iomap_end. The base record also > holds the standard information, which the write's timestamp update > modifies and which is likewise only written out when the record is > marked dirty. > > Fixes: b041ca562526 ("ntfs: update iomap and address space operations") > Signed-off-by: Hongling Zeng > Reviewed-by: Baolin Liu > --- > fs/ntfs/iomap.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/fs/ntfs/iomap.c b/fs/ntfs/iomap.c > index ce916707f69b..8933f432aa68 100644 > --- a/fs/ntfs/iomap.c > +++ b/fs/ntfs/iomap.c > @@ -682,6 +682,15 @@ static int ntfs_write_iomap_begin_resident(struct inode *inode, loff_t offset, > goto out; > } > > + /* > + * The record holding a resident attribute can be an extent record. > + * Mark the record the lookup found dirty here, while the search > + * context still points at it. The writeout of the record cannot > + * overtake the inline copy: it is serialized by the mrec_lock held > + * until iomap_end. > + */ > + mark_mft_record_dirty(ctx->ntfs_ino); > + > a = ctx->attr; > /* The total length of the attribute value. */ > attr_len = le32_to_cpu(a->data.resident.value_length); Looks good to me. Reviewed-by: Baolin Liu