Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp928619pxb; Wed, 6 Apr 2022 04:33:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8QgroWPICB4FilcSwvuyaVOPZ9/jIy6dRHgDcCCbBtZpjHRQrGJBDHbuYbAw80pNhknLN X-Received: by 2002:a17:90a:5409:b0:1ca:8a21:323b with SMTP id z9-20020a17090a540900b001ca8a21323bmr9500291pjh.135.1649244827285; Wed, 06 Apr 2022 04:33:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649244827; cv=none; d=google.com; s=arc-20160816; b=bPor5qcxigfQ61P4sNpeiXvk3WXuU2ggvg7/vvbLKr+BADPvOf1YZyRoYQ8qOfjr2j Kcm3XQIDGLsu0pAHZFP+sqZD7dAaM0DX1QeYpEGgSoyDo734Wc1+1FasKwAZFNr291pP JzyIMbQD6CWEFm7ye6LGy+Cawzo+cWDoEhOSJjqEhu/+wcEPN6LcwyLD8fxkDk6KUAYl KbWqbkjOhXnTPVSXiaxkQ07Z6v7jTvNE1QghD+sRiCdNOouVMIP4/AFQVkyZTXCiQaXC o19SFUHDVx+9ZlC1H6WqU03SptZ55usksHxkZ8ADLqck3ASTAPLIdTuINUEyVXm6Hzqe NTIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=b3qXO97NFkapYikcMXMMo43m1sOo9NkrhAvkxUNmnE0=; b=eTrLQBB/q04o77DPo/ZjYPTccvSGCTuIyTmHyV0XSROPamsltiQ68SXhxfi109aEMJ zk39/gYocB1Y9Pk7p94QHtQ3ypmmfyt1Jnk+mZrzfFcoKKFGcjzNBsLdobt+EVhuSbGc NsOAhLvmlLDl3UnpEEt4BKue2JmczGMVRfB6MXjRKVBewPDOy/GRdQkKfQhZEIc4DLSM Jj7LnY3mVp8MvZcCe09/JBcQRIxCuRG/0Xv8LUUJSVkJlT8vZl9pS3DkLBHHn5G/Mf3p uTfGFMyrYYGjVSj0lTEVIpLGaHRtlpRB26JXADh9dDMc26sqFFsBEv3tt5FqTGskV0n5 RGSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x5-20020a170902ec8500b00156b58145ccsi7512372plg.177.2022.04.06.04.33.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:33:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 753424E81EB; Wed, 6 Apr 2022 02:55:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1447859AbiDEUJe (ORCPT + 99 others); Tue, 5 Apr 2022 16:09:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357778AbiDEOhs (ORCPT ); Tue, 5 Apr 2022 10:37:48 -0400 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7F28126FAB; Tue, 5 Apr 2022 06:16:08 -0700 (PDT) Received: from fsav114.sakura.ne.jp (fsav114.sakura.ne.jp [27.133.134.241]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 235DFlkC033288; Tue, 5 Apr 2022 22:15:47 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav114.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav114.sakura.ne.jp); Tue, 05 Apr 2022 22:15:47 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav114.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 235DFkv5033285 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Tue, 5 Apr 2022 22:15:47 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: <286f411f-8482-6c0b-c005-01d7d20f9dbe@I-love.SAKURA.ne.jp> Date: Tue, 5 Apr 2022 22:15:47 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [syzbot] INFO: task can't die in blkdev_common_ioctl Content-Language: en-US To: Christoph Hellwig Cc: syzbot , axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, Jan Kara References: <0000000000007a4a2d05dba6baa6@google.com> <67179a84-8be7-4c93-e355-2ca50666f960@I-love.SAKURA.ne.jp> From: Tetsuo Handa In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_SBL,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/04/05 15:44, Christoph Hellwig wrote: > On Mon, Apr 04, 2022 at 02:12:14PM +0900, Tetsuo Handa wrote: >> On 2022/04/04 13:58, Christoph Hellwig wrote: >> My patch proposes filemap_invalidate_lock_killable() and converts only >> blkdev_fallocate() case as a starting point. Nothing prevents us from >> converting e.g. blk_ioctl_zeroout() case as well. The "not come through >> blkdev_fallocate" is bogus. > > Sure, we could try to convert most of the > 50 instances of > filemap_invalidate_lock to be killable. But that: > > a) isn't what your patch actuall did We can step by step convert all possible locations. > b) doesn't solve the underlying issue that is wasn't designed to to be > held over very extremely long running operations Do you want to introduce state variables like Lo_rundown in order to avoid holding this invalidate lock? That will be a lot of complication. > > Or to get back to what I said before - I don't think we can just hold > the lock over manually zeroing potentially gigabytes of blocks. > Periodically releasing this invalidate lock may result in inconsistent output. One can issue conflicting request (e.g. enlarging a file and truncating that file). If truncate happens while partially enlarged (or writing non-zero values while partially zeroed), resuming will need to undo what was done during this invalidate lock was released. (Or do you want to make conflicting requests fail with e.g. -EBUSY, possibly breaking userspace programs?) Serialization via holding throughout this zeroing/fallocate operation is needed for returning consistent output. > In other words: we'll need to chunk the zeroing up if we want > to hold the invalidate lock, I see no ther way to properly fix this. I don't think that we can chunk the zeroing/fallocate up, for I don't think that we can determine appropriate chunk size. It might be 4KB, it might be 1MB, it might be 1GB, but who knows which size is safe for avoiding hung task warning on this invalidate lock. The block device might be super slow (e.g. as slow as floppy disk, or networking block device over very slow network). Also, hung task watchdog timeout and concurrent requests colliding on this invalidate lock are not visible to current thread doing actual zeroing/fallocate. All we could afford will be to make this invalidate lock killable and sometimes check fatal_signal_pending() inside zeroing/fallocate loop.