All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard.weinberger@gmail.com>
To: Sascha Hauer <sha@pengutronix.de>
Cc: Richard Weinberger <richard@nod.at>, linux-mtd@lists.infradead.org
Subject: Re: ubifs: ubifs_purge_xattrs() wrongly called
Date: Thu, 21 Jan 2021 09:43:22 +0100	[thread overview]
Message-ID: <CAFLxGvyQ1v17QTWGQbL0yHOZuguFWS9torO-yLWD2zGk3Rkazg@mail.gmail.com> (raw)
In-Reply-To: <20210120133847.GA19063@pengutronix.de>

Sascha,

On Wed, Jan 20, 2021 at 2:45 PM Sascha Hauer <sha@pengutronix.de> wrote:
>
> Hi All,
>
> I just noticed that ubifs_purge_xattrs() is wrongly called from
> ubifs_unlink() when a dentry is deleted. Deleting a dentry doesn't mean
> that the inode the xattrs are attached to is going away. Removing a file
> that has hardlinks will result in removing the xattrs when instead they
> should stay until the last link is removed.

you are right, that's a bug we need to address.

> ubifs_purge_xattrs() only removes the xattrs when their number exceeds
> ubifs_xattr_max_cnt(). Otherwise it does nothing, so it's unlikely to
> hit this bug in real life.

Yes. The idea is being able to remove inodes from old filesystems
where we didn't
had the limitation.

> I am not sure how to fix that. Maybe calling ubifs_purge_xattrs() from
> ubifs_evict_inode() would be correct, but I haven't looked deeper into
> this.

I can't remember right now why I didn't use the evict path.
Hmmm.

-- 
Thanks,
//richard

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

      reply	other threads:[~2021-01-21  8:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20 13:38 ubifs: ubifs_purge_xattrs() wrongly called Sascha Hauer
2021-01-21  8:43 ` Richard Weinberger [this message]

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=CAFLxGvyQ1v17QTWGQbL0yHOZuguFWS9torO-yLWD2zGk3Rkazg@mail.gmail.com \
    --to=richard.weinberger@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=sha@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.