From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Javier Martinez Canillas <javierm@redhat.com>
Cc: linux-kernel@vger.kernel.org,
Lennart Poettering <lennart@poettering.net>,
Colin Walters <walters@verbum.org>,
Peter Jones <pjones@redhat.com>, Alberto Ruiz <aruiz@redhat.com>,
Christian Kellner <ckellner@redhat.com>,
Chung-Chiang Cheng <cccheng@synology.com>,
Muhammad Usama Anjum <usama.anjum@collabora.com>,
Alexander Larsson <alexl@redhat.com>
Subject: Re: [PATCH v4 3/4] fat: add renameat2 RENAME_EXCHANGE flag support
Date: Wed, 08 Jun 2022 23:33:54 +0900 [thread overview]
Message-ID: <87h74vteb1.fsf@mail.parknet.co.jp> (raw)
In-Reply-To: <20220601173204.1372569-4-javierm@redhat.com> (Javier Martinez Canillas's message of "Wed, 1 Jun 2022 19:32:03 +0200")
Javier Martinez Canillas <javierm@redhat.com> writes:
> + /* update ".." directory entry info */
> + if (old_dotdot_de) {
> + err = vfat_update_dotdot_de(new_dir, old_inode, old_dotdot_bh,
> + old_dotdot_de);
> + if (err)
> + goto error_old_dotdot;
> + drop_nlink(old_dir);
> + inc_nlink(new_dir);
> + }
> +
> + if (new_dotdot_de) {
> + err = vfat_update_dotdot_de(old_dir, new_inode, new_dotdot_bh,
> + new_dotdot_de);
> + if (err)
> + goto error_new_dotdot;
> + drop_nlink(new_dir);
> + inc_nlink(old_dir);
> + }
Probably, we should change the nlink only if both of dotdot update are
succeed and different file type. Otherwise, we would have to revert the
nlink change on error path (and can remove unnecessary update as bonus).
Thanks.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
next prev parent reply other threads:[~2022-06-08 14:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-01 17:32 [PATCH v4 0/4] fat: add support for the renameat2 RENAME_EXCHANGE flag Javier Martinez Canillas
2022-06-01 17:32 ` [PATCH v4 1/4] fat: add a vfat_rename2() and make existing .rename callback a helper Javier Martinez Canillas
2022-06-01 17:32 ` [PATCH v4 2/4] fat: factor out reusable code in vfat_rename() as helper functions Javier Martinez Canillas
2022-06-01 17:32 ` [PATCH v4 3/4] fat: add renameat2 RENAME_EXCHANGE flag support Javier Martinez Canillas
2022-06-08 14:33 ` OGAWA Hirofumi [this message]
2022-06-08 16:55 ` Javier Martinez Canillas
2022-06-08 17:10 ` OGAWA Hirofumi
2022-06-08 18:21 ` Javier Martinez Canillas
2022-06-01 17:32 ` [PATCH v4 4/4] selftests/filesystems: add a vfat RENAME_EXCHANGE test Javier Martinez Canillas
2022-06-08 7:56 ` [PATCH v4 0/4] fat: add support for the renameat2 RENAME_EXCHANGE flag Javier Martinez Canillas
2022-06-08 9:42 ` OGAWA Hirofumi
2022-06-08 12:18 ` Javier Martinez Canillas
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=87h74vteb1.fsf@mail.parknet.co.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=alexl@redhat.com \
--cc=aruiz@redhat.com \
--cc=cccheng@synology.com \
--cc=ckellner@redhat.com \
--cc=javierm@redhat.com \
--cc=lennart@poettering.net \
--cc=linux-kernel@vger.kernel.org \
--cc=pjones@redhat.com \
--cc=usama.anjum@collabora.com \
--cc=walters@verbum.org \
/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