From: Jaegeuk Kim Subject: Re: [PATCH 1/5] f2fs: Introduce some information prints in the mount path Date: Wed, 26 Dec 2012 10:55:33 +0900 Message-ID: <1356486933.16178.144.camel@kjgkr> References: <1356145725-19940-1-git-send-email-linkinjeon@gmail.com> Reply-To: jaegeuk.kim@samsung.com Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-rZgAF29Xb1DZmatVauWH" Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Namjae Jeon , Amit Sahrawat To: Namjae Jeon Return-path: In-reply-to: <1356145725-19940-1-git-send-email-linkinjeon@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org --=-rZgAF29Xb1DZmatVauWH Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Could you make them follow the file system convention? Something like "F2FS: blah blah~". Otherwise, how about adding a debugging function to express the prefix? Thanks, 2012-12-22 (=ED=86=A0), 12:08 +0900, Namjae Jeon: > From: Namjae Jeon >=20 > Added few informative prints in the mount path, to convey proper error > in case of mount failure. >=20 > Signed-off-by: Namjae Jeon > Signed-off-by: Amit Sahrawat > --- > fs/f2fs/super.c | 46 ++++++++++++++++++++++++++++++++++++---------- > 1 file changed, 36 insertions(+), 10 deletions(-) >=20 > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > index cf0ffb8..86f8549 100644 > --- a/fs/f2fs/super.c > +++ b/fs/f2fs/super.c > @@ -342,19 +342,29 @@ static int sanity_check_raw_super(struct f2fs_super= _block *raw_super) > { > unsigned int blocksize; > =20 > - if (F2FS_SUPER_MAGIC !=3D le32_to_cpu(raw_super->magic)) > + if (F2FS_SUPER_MAGIC !=3D le32_to_cpu(raw_super->magic)) { > + pr_info("Magic Mismatch, valid(0x%x) - read(0x%x)\n", > + F2FS_SUPER_MAGIC, le32_to_cpu(raw_super->magic)); > return 1; > + } > =20 > /* Currently, support only 4KB block size */ > blocksize =3D 1 << le32_to_cpu(raw_super->log_blocksize); > - if (blocksize !=3D PAGE_CACHE_SIZE) > + if (blocksize !=3D PAGE_CACHE_SIZE) { > + pr_info("Not valid blocksize (%u), supports only 4KB\n", > + blocksize); > return 1; > + } > if (le32_to_cpu(raw_super->log_sectorsize) !=3D > - F2FS_LOG_SECTOR_SIZE) > + F2FS_LOG_SECTOR_SIZE) { > + pr_info("Not valid log sectorsize\n"); > return 1; > + } > if (le32_to_cpu(raw_super->log_sectors_per_block) !=3D > - F2FS_LOG_SECTORS_PER_BLOCK) > + F2FS_LOG_SECTORS_PER_BLOCK) { > + pr_info("Not valid log sectors per block\n"); > return 1; > + } > return 0; > } > =20 > @@ -415,13 +425,16 @@ static int f2fs_fill_super(struct super_block *sb, = void *data, int silent) > return -ENOMEM; > =20 > /* set a temporary block size */ > - if (!sb_set_blocksize(sb, F2FS_BLKSIZE)) > + if (!sb_set_blocksize(sb, F2FS_BLKSIZE)) { > + pr_err("unable to set blocksize\n"); > goto free_sbi; > + } > =20 > /* read f2fs raw super block */ > raw_super_buf =3D sb_bread(sb, 0); > if (!raw_super_buf) { > err =3D -EIO; > + pr_err("unable to read superblock\n"); > goto free_sbi; > } > raw_super =3D (struct f2fs_super_block *) > @@ -443,8 +456,10 @@ static int f2fs_fill_super(struct super_block *sb, v= oid *data, int silent) > goto free_sb_buf; > =20 > /* sanity checking of raw super */ > - if (sanity_check_raw_super(raw_super)) > + if (sanity_check_raw_super(raw_super)) { > + pr_err("Not a valid F2FS filesystem\n"); > goto free_sb_buf; > + } > =20 > sb->s_maxbytes =3D max_file_size(le32_to_cpu(raw_super->log_blocksize))= ; > sb->s_max_links =3D F2FS_LINK_MAX; > @@ -478,18 +493,23 @@ static int f2fs_fill_super(struct super_block *sb, = void *data, int silent) > /* get an inode for meta space */ > sbi->meta_inode =3D f2fs_iget(sb, F2FS_META_INO(sbi)); > if (IS_ERR(sbi->meta_inode)) { > + pr_err("Failed to read F2FS meta data inode\n"); > err =3D PTR_ERR(sbi->meta_inode); > goto free_sb_buf; > } > =20 > err =3D get_valid_checkpoint(sbi); > - if (err) > + if (err) { > + pr_err("Failed to get valid F2FS checkpoint\n"); > goto free_meta_inode; > + } > =20 > /* sanity checking of checkpoint */ > err =3D -EINVAL; > - if (sanity_check_ckpt(raw_super, sbi->ckpt)) > + if (sanity_check_ckpt(raw_super, sbi->ckpt)) { > + pr_err("Not a valid F2FS checkpoint\n"); > goto free_cp; > + } > =20 > sbi->total_valid_node_count =3D > le32_to_cpu(sbi->ckpt->valid_node_count); > @@ -511,17 +531,22 @@ static int f2fs_fill_super(struct super_block *sb, = void *data, int silent) > =20 > /* setup f2fs internal modules */ > err =3D build_segment_manager(sbi); > - if (err) > + if (err) { > + pr_err("Failed to initialize F2FS segment manager\n"); > goto free_sm; > + } > err =3D build_node_manager(sbi); > - if (err) > + if (err) { > + pr_err("Failed to initialize F2FS node manager\n"); > goto free_nm; > + } > =20 > build_gc_manager(sbi); > =20 > /* get an inode for node space */ > sbi->node_inode =3D f2fs_iget(sb, F2FS_NODE_INO(sbi)); > if (IS_ERR(sbi->node_inode)) { > + pr_err("Failed to read node inode\n"); > err =3D PTR_ERR(sbi->node_inode); > goto free_nm; > } > @@ -534,6 +559,7 @@ static int f2fs_fill_super(struct super_block *sb, vo= id *data, int silent) > /* read root inode and dentry */ > root =3D f2fs_iget(sb, F2FS_ROOT_INO(sbi)); > if (IS_ERR(root)) { > + pr_err("Failed to read root inode\n"); > err =3D PTR_ERR(root); > goto free_node_inode; > } --=20 Jaegeuk Kim Samsung --=-rZgAF29Xb1DZmatVauWH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJQ2lkVAAoJEEAUqH6CSFDSZ+EP/1k6WWbV99NXmXjtIoaJ49gW havUupjTfISL7QyTgEME5H8SzZXwdC9rfSKPtiaX290qVwndJERoOU1Zi7lkY3BN xntfcrePuB4sa5drQs9QJr1/F5gK6XB2UEEpbPMliQRKnCXnCrwGZ3Ggp6j15A8J tKnC8PxobyVhVu/vx/PjKwOck7vnEo0uHtj2pqBeCmNpYN/Ms1Fd/Smd9lLHEcN+ UGtqIRvrGypdBagwlh5Sbh4GW5ROhLE4PljUC2wbSMVehEyVMYGlyGp0+e4GtD+s Bxg6Yckf7zA265zWQMJwduUmzRa4S8BLmBdfzfn+NdViQUAt6PrngioAn9yR4vjo A5l889sg4as8OvMs+Fer/neexIAdDOrGN7lkaLU9lBIwK3UsHNyJ79K0Bd1W8Nyz ve6hKs/CEnSUrUa9a68EAQVgHt75kC0UGVOZjhrgvn9YCsQNqvAaht18lmCkoqix +Y8RxrUdYnKjuW2PpuYnfT49uQ4xRo35/6fU7mcQZYeEIZtRMvBlxYdfnYWgY0dE pNAy1m8mapqtYpne0JdnjdQuIWLK+0xiYUgC2CnPlF5JBMwWgls6N74NYPXPEQ6n jKgEf+inmV7XAQPqKRwJLd3qfHEWtgJ9n2DpRJQcDt56KmZ7HRGaFbxknlvlEAUr zKIvUA9D8nBWsBXVF3cK =atdk -----END PGP SIGNATURE----- --=-rZgAF29Xb1DZmatVauWH--