From: Javier Martinez Canillas <javierm@redhat.com>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: linux-kernel@vger.kernel.org, Peter Jones <pjones@redhat.com>,
Alexander Larsson <alexl@redhat.com>,
Colin Walters <walters@verbum.org>,
Alberto Ruiz <aruiz@redhat.com>,
Muhammad Usama Anjum <usama.anjum@collabora.com>,
Lennart Poettering <lennart@poettering.net>,
Chung-Chiang Cheng <cccheng@synology.com>,
Christian Kellner <ckellner@redhat.com>,
Carlos Maiolino <cmaiolin@redhat.com>
Subject: Re: [PATCH v5 3/4] fat: add renameat2 RENAME_EXCHANGE flag support
Date: Thu, 9 Jun 2022 22:36:21 +0200 [thread overview]
Message-ID: <9d837076-f666-c3c3-dd09-5c3705da23e6@redhat.com> (raw)
In-Reply-To: <878rq54pf1.fsf@mail.parknet.co.jp>
Hello OGAWA,
Thanks for your feedback.
On 6/9/22 21:17, OGAWA Hirofumi wrote:
> Javier Martinez Canillas <javierm@redhat.com> writes:
>
>> +static void vfat_update_nlink(struct inode *dir, struct inode *inode)
>> +{
>> + if (S_ISDIR(inode->i_mode))
>> + drop_nlink(dir);
>> + else
>> + inc_nlink(dir);
>> +}
>
> [...]
>
>> + vfat_update_dir_metadata(old_dir, &ts);
>> + /* if directories are not the same, update new_dir as well */
>> + if (old_dir != new_dir) {
>> + vfat_update_dir_metadata(new_dir, &ts);
>> + /* nlink only needs to be updated if the file types differ */
>> + if (old_inode->i_mode != new_inode->i_mode) {
>> + vfat_update_nlink(old_dir, old_inode);
>> + vfat_update_nlink(new_dir, new_inode);
>> + }
>> + }
>
> Looks like unnecessary complex (and comparing raw i_mode, not S_ISDIR(),
> better to change before make dir dirty). How about this change, it is
> only tested slightly though? Can you review and test?
>
Your change looks good to me and indeed the logic is simpler than in mine.
I've also tested it and AFAICT it works correctly as well. Do you plan to
squash this or should I respin a new revision of the whole patch-set ? If
you want to post it as a follow-up I'm also OK with that.
--
Best regards,
Javier Martinez Canillas
Linux Engineering
Red Hat
next prev parent reply other threads:[~2022-06-09 20:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-09 9:36 [PATCH v5 0/4] fat: add support for the renameat2 RENAME_EXCHANGE flag Javier Martinez Canillas
2022-06-09 9:36 ` [PATCH v5 1/4] fat: add a vfat_rename2() and make existing .rename callback a helper Javier Martinez Canillas
2022-06-09 9:36 ` [PATCH v5 2/4] fat: factor out reusable code in vfat_rename() as helper functions Javier Martinez Canillas
2022-06-09 9:36 ` [PATCH v5 3/4] fat: add renameat2 RENAME_EXCHANGE flag support Javier Martinez Canillas
2022-06-09 19:17 ` OGAWA Hirofumi
2022-06-09 20:36 ` Javier Martinez Canillas [this message]
2022-06-10 3:17 ` OGAWA Hirofumi
2022-06-10 6:27 ` Javier Martinez Canillas
2022-06-09 9:36 ` [PATCH v5 4/4] selftests/filesystems: add a vfat RENAME_EXCHANGE test 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=9d837076-f666-c3c3-dd09-5c3705da23e6@redhat.com \
--to=javierm@redhat.com \
--cc=alexl@redhat.com \
--cc=aruiz@redhat.com \
--cc=cccheng@synology.com \
--cc=ckellner@redhat.com \
--cc=cmaiolin@redhat.com \
--cc=hirofumi@mail.parknet.co.jp \
--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
all inboxes | Powered by JetHome®