Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6945682ybi; Thu, 1 Aug 2019 00:47:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqzW09q74rgD95DT2NHozyW26ZU2EB7pXlQdQKQyPPpbc/TLoYnNMEPA4j5Zsg+8734lqlfq X-Received: by 2002:a17:902:2f84:: with SMTP id t4mr121046724plb.57.1564645627449; Thu, 01 Aug 2019 00:47:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564645627; cv=none; d=google.com; s=arc-20160816; b=cgKiND6ut+Erekzf7GU8MLtZrGNvxqEc4hvNrDadTB83D6wscytsYjvplTUmke1rYm F08y/bv2TbDEk6VMmZOrFi+veNvk2Ou8FsF5ytrr9gKXI9caORgZtSQk/XQF1pyqxIbH 6J7OLXTwP6bTGgO9yHu3mXmc6yIl3e9kevf70bOe+qloKDFSogmBSDLPUTdWNCaYQ6NX UiSy0B9chOVh5Ux1qTXDfauNPvdFrYE22fsNVwrcoXGf/ORI90agzT2m9RcMjlQXOUAr 3wy50QpGXXXpH8gii+Ik9iOUDFxCFPo65bQhAjs03LblFp050GBlsuteMPRAU2tTiOgY NONA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=DJcEyIYxjp82cRetKxNep8oo+2k3ON/IVcU/IMsVkyI=; b=Pa69qsn0eIjRNLBN+a5ePjNNvQZxIWfC7gj3UMf6vFhBFO8xF6QJSFC4wm7Hjp/Nvz Kj/FJuizgZD3/mLueAmgttvs3JnG28xJvCQKfLuIzLCsBjEtpIAFxuvnR5lbNV/IdbpT 9QOKV0s/dhsYq8pvy4ESppb4geUolSTdmFJVJV8PSoeQuX66VL+SoIjZLLYMQkWd8+zD IyRA0wiwJgyzcMGTJn+MngTz7gWP9e8YxFkZk+h3j+B+iYkGTY+wEcXUDK0+HHCy8xnD N3GjMZWyleLalTA1g0akUpjt48zMcCMWHzcp0su+EeIskQ9UgF+/rRg4UR5sJIHeYT2g dl0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9si33655564pgb.478.2019.08.01.00.46.52; Thu, 01 Aug 2019 00:47:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730396AbfHAHfd (ORCPT + 99 others); Thu, 1 Aug 2019 03:35:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:58244 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725946AbfHAHfd (ORCPT ); Thu, 1 Aug 2019 03:35:33 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BF555AF0D; Thu, 1 Aug 2019 07:35:31 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id DFF791E3F4D; Thu, 1 Aug 2019 09:35:30 +0200 (CEST) Date: Thu, 1 Aug 2019 09:35:30 +0200 From: Jan Kara To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Roald Strauss , "Steven J. Magnani" , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: UDF filesystem image with Write-Once UDF Access Type Message-ID: <20190801073530.GA25064@quack2.suse.cz> References: <20190712100224.s2chparxszlbnill@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190712100224.s2chparxszlbnill@pali> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On Fri 12-07-19 12:02:24, Pali Roh?r wrote: > I had discussion with Roald and based on his tests, Linux kernel udf.ko > driver mounts UDF filesystem image with Write-Once UDF Access Type as > normal read/write filesystem. > > I think this is a bug as Write-Once Access Type is defined that existing > blocks on filesystem cannot be rewritten. Only new blocks can be > appended after end of device. Basically it means special HW support from > underlying media, e.g. for optical medias packet-writing technique (or > ability to burn new session) and CDROM_LAST_WRITTEN ioctl to locate > "current" end of device. > > In my opinion without support for additional layer, kernel should treat > UDF Write-Once Access Type as read-only mount for userspace. And not > classic read/write mount. > > If you want to play with Write-Once Access Type, use recent version of > mkudffs and choose --media-type=cdr option, which generates UDF > filesystem suitable for CD-R (Write-Once Access Type with VAT and other > UDF options according to UDF specification). Reasonably recent kernels should have this bug fixed and mount such fs read only. That being said I've tested current upstream kernel with a media created with --media-type=cdr and mounting failed with: UDF-fs: error (device ubdb): udf_read_inode: (ino 524287) failed !bh UDF-fs: error (device ubdb): udf_read_inode: (ino 524286) failed !bh UDF-fs: error (device ubdb): udf_read_inode: (ino 524285) failed !bh UDF-fs: error (device ubdb): udf_read_inode: (ino 524284) failed !bh UDF-fs: Scanning with blocksize 2048 failed So there's something fishy either in the created image or the kernel... Didn't debug this further yet. > Also in git master of udftools has mkduffs now new option --read-only > which creates UDF image with Read-Only Access Type. I've tested this and the kernel properly mounts the image read-only. > It seems that udf.ko does not support updating VAT table, so probably it > should treat also filesystem with VAT as read-only too. This is definitely handled properly and we mount such fs read-only as well. Honza -- Jan Kara SUSE Labs, CR