From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f193.google.com ([209.85.192.193]:33677 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750938AbdA0TaR (ORCPT ); Fri, 27 Jan 2017 14:30:17 -0500 Subject: Re: [RFC][PATCH v2 4/4] vfs: wrap write f_ops with file_{start,end}_write() To: Amir Goldstein , Miklos Szeredi References: <1485174742-15866-2-git-send-email-amir73il@gmail.com> <1485200596-14057-1-git-send-email-amir73il@gmail.com> Cc: mtk.manpages@gmail.com, Jan Kara , Al Viro , "linux-unionfs@vger.kernel.org" , linux-fsdevel , Christoph Hellwig , "Darrick J. Wong" From: "Michael Kerrisk (man-pages)" Message-ID: Date: Sat, 28 Jan 2017 08:30:07 +1300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 01/28/2017 05:20 AM, Amir Goldstein wrote: > On Fri, Jan 27, 2017 at 1:50 PM, Amir Goldstein wrote: >> On Fri, Jan 27, 2017 at 1:09 PM, Miklos Szeredi wrote: >>> On Mon, Jan 23, 2017 at 8:43 PM, Amir Goldstein wrote: >>>> Before calling write f_ops, call file_start_write() instead >>>> of sb_start_write(). >>>> >>>> This ensures freeze protection for both overlay and upper fs >>>> when file is open from an overlayfs mount. >>>> >>>> Replace {sb,file}_start_write() for {copy,clone}_file_range() and >>>> for fallocate(). >>>> >>>> For dedup_file_range() there is no need for mnt_want_write_file(). >>>> File is already open for write, so we already have mnt_want_write() >>>> and we only need file_start_write(). >>> >>> Being opened for write is not verified if capable(CAP_SYS_ADMIN). >>> Ugly special case, don't ask me why it's done... >>> >> >> Christoph, Darrick, is that by design? > > Anyway, whether is makes sense or not, that's a legacy from > BTRFS_IOC_FILE_EXTENT_SAME, we probably have to live with. > > Michael, I recon man page needs updating. Sorry--can you elaborate on what changes are required? Thanks, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/