From: Aditya Garg <gargaditya08@live.com>
To: Viacheslav Dubeyko <slava@dubeyko.com>
Cc: "willy@infradead.org" <willy@infradead.org>,
"ira.weiny@intel.com" <ira.weiny@intel.com>,
"axboe@kernel.dk" <axboe@kernel.dk>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"bvanassche@acm.org" <bvanassche@acm.org>,
"keescook@chromium.org" <keescook@chromium.org>,
"songmuchun@bytedance.com" <songmuchun@bytedance.com>,
"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] hfsplus: Fix bug causing custom uid and gid being unable to be assigned with mount
Date: Tue, 6 Dec 2022 08:12:16 +0000 [thread overview]
Message-ID: <FBF299DB-E235-4BD3-82BD-5A54EE9E26DA@live.com> (raw)
In-Reply-To: <A2B962C1-AD33-413D-B64A-CD179AFBEA8D@dubeyko.com>
> Before this change, logic called i_uid_read(inode) and checked mode.
> Now, we check only HFSPLUS_SB_UID/HFSPLUS_SB_GID flags.
> So, if we mount HFS+ volume by “sudo mount /dev/sda1 /mnt”, then
> HFSPLUS_SB_UID and HFSPLUS_SB_GID flags will be unset.
> And current logic will do nothing. Is it correct logic? Maybe, we need
> to use sbi->uid/gid if flag(s)HFSPLUS_SB_UID/HFSPLUS_SB_GID are set.
> And if not, then to use old logic. Am I correct here? Or am I still missing
> something here?
Well initially I when I tried to investigate what’s wrong, and found that the old logic was the culprit, I did some logging to see what exactly was wrong. The log patch is here btw :- https://github.com/AdityaGarg8/linux/commit/f668fb012f595d83053020b88b9439c295b4dc21
So I saw that the old logic was always false, no matter whether I mounted with uid or not.
I tried to see what makes this true, but couldn't succeed. So, I thought of a simpler approach and changed the logic itself.
To be honest, I dunno what is the old logic for. Maybe instead of completely removing the old logic, I could use an OR?
If you think its more logical, I can make this change :-
- if (!i_gid_read(inode) && !mode)
+ if ((test_bit(HFSPLUS_SB_UID, &sbi->flags)) || (!i_uid_read(inode) && !mode))
Thanks
Aditya
next prev parent reply other threads:[~2022-12-06 8:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-02 15:39 Aditya Garg
2022-12-02 20:52 ` Viacheslav Dubeyko
2022-12-03 7:56 ` Aditya Garg
2022-12-06 0:35 ` Viacheslav Dubeyko
2022-12-06 8:12 ` Aditya Garg [this message]
2022-12-06 8:49 ` Aditya Garg
2022-12-06 18:56 ` Viacheslav Dubeyko
2022-12-07 3:04 ` Aditya Garg
2022-12-07 3:05 ` [PATCH v2] " Aditya Garg
2022-12-07 20:17 ` Viacheslav Dubeyko
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=FBF299DB-E235-4BD3-82BD-5A54EE9E26DA@live.com \
--to=gargaditya08@live.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=ira.weiny@intel.com \
--cc=keescook@chromium.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=slava@dubeyko.com \
--cc=songmuchun@bytedance.com \
--cc=torvalds@linux-foundation.org \
--cc=willy@infradead.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®