ocfs2-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/2] ocfs2: clear links count in ocfs2_mknod() if an error occurs
Date: Wed, 27 May 2020 15:52:20 -0700	[thread overview]
Message-ID: <20200527155220.df299b5a7326f1e63f366113@linux-foundation.org> (raw)
In-Reply-To: <d8147c41-fb2b-bdf7-b660-1f3c8448c33f@huawei.com>

On Tue, 26 May 2020 15:45:35 +0800 Wangyan <wangyan122@huawei.com> wrote:

> In this condition, the inode can not be wiped when error happened.
> ocfs2_mkdir()
>   ->ocfs2_mknod()
>     ->ocfs2_mknod_locked()
>       ->__ocfs2_mknod_locked()
>         ->ocfs2_set_links_count() // i_links_count is 2
>     -> ... // an error accrue, goto roll_back or leave.
>     ->ocfs2_commit_trans()
>     ->iput(inode)
>       ->evict()
>         ->ocfs2_evict_inode()
>           ->ocfs2_delete_inode()
>             ->ocfs2_inode_lock()
>               ->ocfs2_inode_lock_update()
>                 ->ocfs2_refresh_inode()
>                   ->set_nlink();    // inode->i_nlink is 2 now.
>             /* if wipe is 0, it will goto bail_unlock_inode */
>             ->ocfs2_query_inode_wipe()
>               ->if (inode->i_nlink) return; // wipe is 0.
>             /* inode can not be wiped */
>             ->ocfs2_wipe_inode()
> So, we need clear links before the transaction committed.

Do we think these fixes should be backported into -stable kernels?

  reply	other threads:[~2020-05-27 22:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26  7:45 [Ocfs2-devel] [PATCH 1/2] ocfs2: clear links count in ocfs2_mknod() if an error occurs Wangyan
2020-05-27 22:52 ` Andrew Morton [this message]
2020-05-28  0:43   ` Wangyan
2020-06-01  8:30 ` Joseph Qi
2020-08-07  3:49   ` Andrew Morton
2022-10-16 23:32     ` Andrew Morton via Ocfs2-devel
2022-10-17  1:57       ` Joseph Qi via Ocfs2-devel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200527155220.df299b5a7326f1e63f366113@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).