xfs
[Top] [All Lists]

Re: Mount probing not silent. Internal error xfs_sb_read_verify at line

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: Mount probing not silent. Internal error xfs_sb_read_verify at line 726
From: Markus Trippelsdorf <markus@xxxxxxxxxxxxxxx>
Date: Tue, 7 May 2013 15:43:10 +0200
Cc: Eric Sandeen <sandeen@xxxxxxxxxxx>, xfs@xxxxxxxxxxx, util-linux@xxxxxxxxxxxxxxx, Karel Zak <kzak@xxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=simple; d=mail.ud10.udmedia.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=beta; bh=y8bYX6wrV+YMABkkzdG3HEZa03 Ypz8dh/zkuhFG2O6g=; b=u5tvZvOyMlnt0TDA3ZnZsWzyH+idPjYJHWu5MckRs9 OdcKZodVrj4OdXRciu0Led3elWR9Y2VTDhF7EeRcofB0xwMwMH91r67DhnuQKFLC GRv3mhoP/JDIPa7/NCnsZOqcqE06ykn+ii4BFQAlXitEkHnNmxvE1LAnTxBFojsY 0=
In-reply-to: <20130507052430.GA508@x4>
References: <5187E290.8090109@xxxxxxxxxxx> <20130506183020.GA513@x4> <51880121.8000001@xxxxxxxxxxx> <20130506192629.GA503@x4> <5188074F.2090500@xxxxxxxxxxx> <20130506195521.GB503@x4> <51881750.3090309@xxxxxxxxxxx> <51882537.6070904@xxxxxxxxxxx> <20130507002314.GM19978@dastard> <20130507052430.GA508@x4>
On 2013.05.07 at 07:24 +0200, Markus Trippelsdorf wrote:
> On 2013.05.07 at 10:23 +1000, Dave Chinner wrote:
> > That's just completely broken mount behaviour. Probing is supposed
> > to be *silent*, and this is just downright obnxious. Here's what I
> > get in my log after doing this:
> > 
> > # dd if=/dev/zero of=/dev/vdb bs=512 count=1
> > # blkid -g
> > # mount  /dev/vdb /mnt/scratch/
> > mount: you must specify the filesystem type
> > $ dmesg
> > ......
> > [83182.775467] REISERFS warning (device vdb): sh-2021 reiserfs_fill_super: 
> > can not find reiserfs on vdb
> > [83182.778473] EXT3-fs (vdb): error: can't find ext3 filesystem on dev vdb.
> > [83182.781135] EXT2-fs (vdb): error: can't find an ext2 filesystem on dev 
> > vdb.
> > [83182.783524] EXT4-fs (vdb): VFS: Can't find ext4 filesystem
> > [83182.787392] cramfs: wrong magic
> > [83182.788926] SQUASHFS error: Can't find a SQUASHFS superblock on vdb
> > [83182.791150] VFS: Can't find a Minix filesystem V1 | V2 | V3 on device 
> > vdb.
> > [83182.793737] FAT-fs (vdb): bogus number of reserved sectors
> > [83182.795202] FAT-fs (vdb): Can't find a valid FAT filesystem
> > [83182.797268] FAT-fs (vdb): bogus number of reserved sectors
> > [83182.798984] FAT-fs (vdb): Can't find a valid FAT filesystem
> > [83182.801236] BFS-fs: bfs_fill_super(): No BFS filesystem on vdb 
> > (magic=00000000)
> > [83182.846555] ISOFS: Unable to identify CD-ROM format.
> > [83182.849136] hfs: unable to find HFS+ superblock
> > [83182.851164] hfs: can't find a HFS filesystem on dev vdb.
> > [83182.853204] vxfs: WRONG superblock magic
> > [83182.856855] VFS: unable to find oldfs superblock on device vdb
> > [83182.858930] VFS: could not find a valid V7 on vdb.
> > [83182.860938] NTFS-fs error (device vdb): read_ntfs_boot_sector(): Primary 
> > boot sector is invalid.
> > [83182.863247] NTFS-fs error (device vdb): read_ntfs_boot_sector(): Mount 
> > option errors=recover not used. Aborting without trying to recover.
> > [83182.866563] NTFS-fs error (device vdb): ntfs_fill_super(): Not an NTFS 
> > volume.
> > [83182.873922] AFFS: No valid root block on device vdb
> > [83182.875697] VFS: Can't find a romfs filesystem on dev vdb.
> > [83182.877823] qnx4: wrong fsid in superblock.
> > [83182.884286] UDF-fs: warning (device vdb): udf_load_vrs: No VRS found
> > [83182.886217] UDF-fs: Rescanning with blocksize 2048
> > [83182.891965] UDF-fs: warning (device vdb): udf_load_vrs: No VRS found
> > [83182.893730] UDF-fs: warning (device vdb): udf_fill_super: No partition 
> > found (1)
> > [83182.896216] omfs: Invalid superblock (0)
> > [83182.898937] XFS (vdb): bad magic number
> > [83182.900150] ffff88007bbce000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
> > 00 00  ................
> > [83182.902676] ffff88007bbce010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
> > 00 00  ................
> > [83182.905281] ffff88007bbce020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
> > 00 00  ................
> > [83182.907845] ffff88007bbce030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
> > 00 00  ................
> > [83182.910559] XFS (vdb): Internal error xfs_sb_read_verify at line 726 of 
> > file fs/xfs/xfs_mount.c.  Caller 0xffffffff814645e5
> > [83182.910559]
> > [83182.914377] Pid: 1064, comm: kworker/0:1H Not tainted 3.9.0-rc8-dgc+ #575
> > [83182.916499] Call Trace:
> > [83182.917245]  [<ffffffff8146761f>] xfs_error_report+0x3f/0x50
> > [83182.918762]  [<ffffffff814645e5>] ? xfs_buf_iodone_work+0xc5/0xf0
> > [83182.920113]  [<ffffffff8146768e>] xfs_corruption_error+0x5e/0x90
> > [83182.921351]  [<ffffffff814cf50a>] xfs_sb_read_verify+0x11a/0x130
> > [83182.922692]  [<ffffffff814645e5>] ? xfs_buf_iodone_work+0xc5/0xf0
> > [83182.923972]  [<ffffffff810b6555>] ? finish_task_switch+0x65/0x100
> > [83182.925343]  [<ffffffff814645e5>] xfs_buf_iodone_work+0xc5/0xf0
> > [83182.926634]  [<ffffffff810a35d0>] process_one_work+0x170/0x400
> > [83182.927832]  [<ffffffff810a4f26>] worker_thread+0x116/0x390
> > [83182.929116]  [<ffffffff810a4e10>] ? busy_worker_rebind_fn+0xb0/0xb0
> > [83182.930460]  [<ffffffff810aadd8>] kthread+0xd8/0xe0
> > [83182.931469]  [<ffffffff810aad00>] ? kthread_create_on_node+0x140/0x140
> > [83182.932921]  [<ffffffff81c23dec>] ret_from_fork+0x7c/0xb0
> > [83182.934047]  [<ffffffff810aad00>] ? kthread_create_on_node+0x140/0x140
> > [83182.935489] XFS (vdb): Corruption detected. Unmount and run xfs_repair
> > [83182.937045] XFS (vdb): SB validate failed with error 22.
> > [83182.940181] NILFS: Can't find nilfs on dev vdb.
> > [83182.941321] BeFS(vdb): No write support. Marking filesystem read-only
> > [83182.943036] BeFS(vdb): invalid magic header
> > [83182.946526] (mount,23815,1):ocfs2_fill_super:1039 ERROR: superblock 
> > probe failed!
> > [83182.948515] (mount,23815,1):ocfs2_fill_super:1230 ERROR: status = -22
> > [83182.951606] GFS2: not a GFS2 filesystem
> > [83182.952898] GFS2: gfs2 mount does not exist
> > [83182.954425] F2FS-fs (vdb): Magic Mismatch, valid(0xf2f52010) - 
> > read(0x49474158)
> > [83182.956540] F2FS-fs (vdb): Can't find a valid F2FS filesystem in first 
> > superblock
> > [83182.959044] F2FS-fs (vdb): Magic Mismatch, valid(0xf2f52010) - read(0x0)
> > [83182.960894] F2FS-fs (vdb): Can't find a valid F2FS filesystem in second 
> > superblock
> > 
> > I've removed logfs from my kernels because this probing causes
> > logfs to oops the kernel...
> > 
> > I think that mount needs fixing, not XFS. mount needs to be doing
> > silent mounts when doing this brute forcing, not noisy, explicit
> > mounts that we expect to throw errors if there is a problem.
> 
> > BTW, strace indicates that MS_SILENT is not being used during brute
> > force mounts:
> > 
> > # strace -vx mount /dev/vdb /mnt/scratch/ 2>&1 |grep ^mount
> > mount("/dev/vdb", "/mnt/scratch/", "reiserfs", MS_MGC_VAL, NULL) = -1 
> > EINVAL (Invalid argument)
> > mount("/dev/vdb", "/mnt/scratch/", "ext3", MS_MGC_VAL, NULL) = -1 EINVAL 
> > (Invalid argument)
> > mount("/dev/vdb", "/mnt/scratch/", "ext2", MS_MGC_VAL, NULL) = -1 EINVAL 
> > (Invalid argument)
> > mount("/dev/vdb", "/mnt/scratch/", "ext4", MS_MGC_VAL, NULL) = -1 EINVAL 
> > (Invalid argument)
> > ....
> > 
> > So this really looks like a bug in mount, not the filesystem handling
> > of slient mounts...

What about the following patch?

diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
index d287361..31053b9 100644
--- a/libmount/src/context_mount.c
+++ b/libmount/src/context_mount.c
@@ -658,7 +658,7 @@ static int do_mount(struct libmnt_context *cxt, const char 
*try_type)
        type = try_type ? : mnt_fs_get_fstype(cxt->fs);
 
        if (!(flags & MS_MGC_MSK))
-               flags |= MS_MGC_VAL;
+               flags |= (MS_MGC_VAL|MS_SILENT);
 
        DBG(CXT, mnt_debug_h(cxt, "%smount(2) "
                        "[source=%s, target=%s, type=%s, "

-- 
Markus

<Prev in Thread] Current Thread [Next in Thread>