From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com ([134.134.136.100]:38765 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752959AbdKQVOk (ORCPT ); Fri, 17 Nov 2017 16:14:40 -0500 Date: Fri, 17 Nov 2017 14:14:34 -0700 From: Ross Zwisler Subject: Re: [xfsprogs PATCH 2/2] xfs_io: add a new 'log_writes' command Message-ID: <20171117211434.GB16597@linux.intel.com> References: <20171117202524.24696-1-ross.zwisler@linux.intel.com> <20171117202524.24696-3-ross.zwisler@linux.intel.com> <84006b9c-90db-7eea-0bdc-b73da1bb1394@sandeen.net> <20171117204801.GA16597@linux.intel.com> <960d0051-d357-033a-0ab7-9eb99d8e63fa@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <960d0051-d357-033a-0ab7-9eb99d8e63fa@sandeen.net> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Eric Sandeen Cc: Ross Zwisler , linux-xfs , linux-nvdimm , fstests , Jan Kara , Dave Chinner , Dan Williams On Fri, Nov 17, 2017 at 03:03:39PM -0600, Eric Sandeen wrote: > On 11/17/17 2:48 PM, Ross Zwisler wrote: > > On Fri, Nov 17, 2017 at 02:39:07PM -0600, Eric Sandeen wrote: > >> On 11/17/17 2:25 PM, Ross Zwisler wrote: > >>> Add a new 'log_writes' command to xfs_io so that we can add dm-log-writes > >>> log marks via the external 'dmsetup' executable. It's helpful to allow > >>> users of xfs_io to adds these marks from within xfs_io instead of waiting > >>> until after xfs_io exits because then they are able to replay the > >>> dm-log-writes log up to immediately after another xfs_io operation such as > >>> mwrite. This isolates the log replay from other operations that happen as > >>> part of xfs_io exiting (file handles being closed, mmaps being torn down, > >>> etc.). This also allows users to insert multiple marks between different > >>> xfs_io commands. > >>> > >>> Signed-off-by: Ross Zwisler > >>> Suggested-by: Dave Chinner > >> > >> Without reviewing in detail, what is the advantage of wrapping dmsetup > >> into xfs_io? My first inclination is that there is none at all, and > >> xfstests can call dmsetup as easily as they can call xfs_io. No? > >> > >> -Eric > > > > I commented on this a bit in the changelog for the 2nd patch: > > > > It's helpful to allow users of xfs_io to adds these marks from within xfs_io > > instead of waiting until after xfs_io exits because then they are able to > > replay the dm-log-writes log up to immediately after another xfs_io operation > > such as mwrite. This isolates the log replay from other operations that > > happen as part of xfs_io exiting (file handles being closed, mmaps being torn > > down, etc.). This also allows users to insert multiple marks between > > different xfs_io commands. > > > > I agree that the shell-out to dmsetup isn't awesome... For the current test I > > have written I think we can get away with just assuming that the xfs_io exit > > stuff won't interact too heavily with the dm-log-writes log, and we could > > potentially move the dmsetup call back into the fstest. This is how I > > initially had it, and moved it into the C program via shell-out in response to > > Amir's feedback: > > Sorry, terrible of me to not have read that. :( Ok, so next question - > DM_TARGET_MSG seems to be public, can we just invoke the ioctl directly > instead of shelling out to dmsetup? > > I'm checking w/ the dm folks too, to make sure that's expected to work. As > long as the use isn't too tricky it seems like that might be better. Yea, that seems like a better option - I'll take a look. Thanks for the suggestion.