| To: | Eric Sandeen <sandeen@xxxxxxxxxxx> |
|---|---|
| Subject: | Re: xfs_iunlink_remove: xfs_inotobp() returned error 22 -- debugging |
| From: | 符永涛 <yongtaofu@xxxxxxxxx> |
| Date: | Thu, 18 Apr 2013 16:25:38 +0800 |
| Cc: | Brian Foster <bfoster@xxxxxxxxxx>, "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx> |
| Delivered-to: | xfs@xxxxxxxxxxx |
| Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=OZmqLQwdoqZ4yOEFMD1PZ49Y+n+Ir6JVxgJFcvsuiZg=; b=ahI73k2TA0rzpVrB9uOS8GtmuZBhIAvij5vio0cWSpf2N72N6TUrV4hUWYnm6UJq0k q3eLjONgEqlgzY/oP6geMdvpO2wZWlqdGFb4GFqPfoFy+Va25htaO5D5CBnOBGJSqmhz +bcEjj5G8/N30E++4Rqc39sBMOF0xkfW910NaT0fMUdyC9uMIr19Ib5nO3cAM/goZikT OvhNd00AqiJc5+RP2FUyl7dygL75QgGdlxj+fg+xCGdn8J8D769OaCnf3+cilE+Ql/Jb tTaB+Xfbtq2GP+Mb8eYTgEa6V3wlVgdXIPvHyVVBfJPIFtASY/hPKIOTXouo9qdNviVh WlWw== |
| In-reply-to: | <CADFMGuLDwde8te0Cs4-T9fdVmq2v22fmSTgkYbULHS3voHzw6A@xxxxxxxxxxxxxx> |
| References: | <516C89DF.4070904@xxxxxxxxxx> <20130416162417.GC13938@destitution> <516D87E3.2010605@xxxxxxxxxx> <CADFMGuLgU2++ym4U9axhevV_L2t-2CMVaDoT5cyQcew2YZMsBA@xxxxxxxxxxxxxx> <CADFMGuK3cPSmqZoMdFSSqOnUz3GLv+c01xXHDhzv9_dfUNUPPA@xxxxxxxxxxxxxx> <CADFMGu+XD=-NJm3CAsnKpiMWykPj67t2LHgtxkPpyTpVmG3LDA@xxxxxxxxxxxxxx> <CADFMGu+z32O5mVBfO6gb8F03y9mrwB5=nf+7LMbky4ttk2mbFw@xxxxxxxxxxxxxx> <BA50C18A-BE51-4658-B05E-3EDB0F11BE36@xxxxxxxxxxx> <CADFMGuKfXwY=Z9dg6+wyX7mKzppu1hQhsqxcr9Fd=DjP4hii9w@xxxxxxxxxxxxxx> <CADFMGuLDwde8te0Cs4-T9fdVmq2v22fmSTgkYbULHS3voHzw6A@xxxxxxxxxxxxxx> |
|
Hi Brian and Eric, Can I change as following to bypass it?--- a/xfs_inode.c +++ b/xfs_inode.c @@ -1764,7 +1764,7 @@ xfs_iunlink_remove( */ next_agino = be32_to_cpu(agi->agi_unlinked[bucket_index]); last_ibp = NULL; - while (next_agino != agino) { + while (next_agino != agino && next_agino != NULLAGINO) { /* * If the last inode wasn't the one pointing to * us, then release its buffer since we're not @@ -1786,6 +1786,14 @@ xfs_iunlink_remove( ASSERT(next_agino != NULLAGINO); ASSERT(next_agino != 0); } + if (next_agino == NULLAGINO) { + /* + *After search the list for the inode being free + *we still can't find it. + */ + xfs_err(mp, "%s ino %lld not found in unlinked list.", + __func__, (unsigned long long)ip->i_ino); + } /* * Now last_ibp points to the buffer previous to us on * the unlinked list. Pull us from the list. @@ -1810,16 +1818,20 @@ xfs_iunlink_remove( } else { xfs_trans_brelse(tp, ibp); } - /* - * Point the previous inode on the list to the next inode. - */ - last_dip->di_next_unlinked = cpu_to_be32(next_agino); - ASSERT(next_agino != 0); - offset = last_offset + offsetof(xfs_dinode_t, di_next_unlinked); - xfs_trans_inode_buf(tp, last_ibp); - xfs_trans_log_buf(tp, last_ibp, offset, - (offset + sizeof(xfs_agino_t) - 1)); - xfs_inobp_check(mp, last_ibp); + if (next_agino != NULLAGINO) { + /* + * If only find the inode being free then we modify + * the unlinked list. + * Point the previous inode on the list to the next inode. + */ + last_dip->di_next_unlinked = cpu_to_be32(next_agino); + ASSERT(next_agino != 0); + offset = last_offset + offsetof(xfs_dinode_t, di_next_unlinked); + xfs_trans_inode_buf(tp, last_ibp); + xfs_trans_log_buf(tp, last_ibp, offset, + (offset + sizeof(xfs_agino_t) - 1)); + xfs_inobp_check(mp, last_ibp); + } } return 0; } 2013/4/18 符永涛 <yongtaofu@xxxxxxxxx>
-- 符永涛 |
| Previous by Date: | Re: xfs_iunlink_remove: xfs_inotobp() returned error 22 -- debugging, 符永涛 |
|---|---|
| Next by Date: | [PATCH] xfsprogs: xfs_quota allow user or group names beginning with digits, rjohnston |
| Previous by Thread: | Re: xfs_iunlink_remove: xfs_inotobp() returned error 22 -- debugging, 符永涛 |
| Next by Thread: | Re: xfs_iunlink_remove: xfs_inotobp() returned error 22 -- debugging, Brian Foster |
| Indexes: | [Date] [Thread] [Top] [All Lists] |