From: Artem Bityutskiy <dedekind1@gmail.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [RFC] killing boilerplate checks in ->link/->mkdir/->rename
Date: Mon, 06 Feb 2012 10:50:44 +0200 [thread overview]
Message-ID: <1328518244.22240.25.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <20120203170825.GX23916@ZenIV.linux.org.uk>
[-- Attachment #1: Type: text/plain, Size: 1546 bytes --]
On Fri, 2012-02-03 at 17:08 +0000, Al Viro wrote:
> On Fri, Feb 03, 2012 at 01:16:12AM +0000, Al Viro wrote:
>
> > * ubifs, hfsplus, jffs2 - definitely broken if you create enough
> > links. i_nlink wraparound to zero, confused inode eviction logics.
>
> BTW, ubifs plays funny games with i_nlink - decrements it early in
> unlink/rmdir/rename and then increments it back on failure. *If*
> we really want it that way, we need to use set_nlink() there. Frankly,
> I'd rather deal with drop_nlink() after the last possible failure
> exit... Unless there are serious reasons why that wouldn't work, that is.
> Artem?
The way code is organized is that the UBIFS journal subsystem functions
accept 'struct inode' and struct direntry' objects and write them out to
the media as they are in RAM. So before calling 'ubifs_jnl_update()' we
should have all the fields in 'struct inode' to be set correctly. Thus,
we have to drop 'i_nlink' before calling 'ubifs_jnl_update()'.
WRT dealing with 'drop_nlink()' after the last possible failure - I can
just make own partial copy of 'struct inode' and pass it to
'ubifs_jnl_update()', if there is a need. I would not like to make the
journal code more complex than it already is by adding 'i_nlink' usage
smartness.
WRT 'sen_nlink()' - I can use it instead of 'drop_nlink()'/'inc_nlink()'
of course. But I do not really see why is this better. E.g.,
'drop_nlink()' additionally gives me ' WARN_ON()' in case of 'i_nlink'
wrapping.
--
Best Regards,
Artem Bityutskiy
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-02-06 8:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20120130222717.GA6393@kroah.com>
[not found] ` <m18vkoirv9.fsf@fess.ebiederm.org>
[not found] ` <4F27C6EB.2070305@suse.cz>
[not found] ` <m14nvc82jo.fsf@fess.ebiederm.org>
[not found] ` <CA+55aFwZNdoAA9iPMiEp8-+ndgV+CtSZO4neSh_L+gd77k7-vg@mail.gmail.com>
[not found] ` <m1wr87ywex.fsf@fess.ebiederm.org>
[not found] ` <m1ehueyz20.fsf_-_@fess.ebiederm.org>
[not found] ` <CA+55aFyNQnXrL7fWhBt4LYBuoHD_x+j=Af-N=ueFMBkymy9Rnw@mail.gmail.com>
[not found] ` <CA+55aFzZX544ZDN9vN3jWMWZ=_9ZtpZ9cR6gNEzUnx9RCqR5LQ@mail.gmail.com>
[not found] ` <20120202012258.GQ23916@ZenIV.linux.org.uk>
2012-02-02 21:24 ` [RFC] killing boilerplate checks in ->link/->mkdir/->rename Al Viro
2012-02-02 23:46 ` Linus Torvalds
2012-02-03 1:16 ` Al Viro
2012-02-03 1:45 ` Al Viro
2012-02-03 2:00 ` Linus Torvalds
2012-02-03 14:57 ` Chris Mason
2012-02-03 17:08 ` Al Viro
2012-02-03 19:34 ` Artem Bityutskiy
2012-02-06 8:50 ` Artem Bityutskiy [this message]
2012-02-06 13:56 ` Al Viro
2012-02-06 17:05 ` Artem Bityutskiy
2012-02-06 17:11 ` Al Viro
2012-02-07 7:21 ` Artem Bityutskiy
2012-02-06 22:49 ` Dave Chinner
2012-02-03 8:25 ` Andreas Dilger
2012-02-03 17:03 ` Al Viro
2012-02-04 7:42 ` Andreas Dilger
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=1328518244.22240.25.camel@sauron.fi.intel.com \
--to=dedekind1@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@ZenIV.linux.org.uk \
/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).