autofs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
To: Ian Kent <raven@themaw.net>
Cc: Jeff Mahoney <jeffm@suse.com>, autofs@vger.kernel.org
Subject: Re: [PATCH v2] autofs: Add WARN_ON(1) for non dir/link inode case
Date: Thu, 7 Jul 2016 15:46:43 +0900	[thread overview]
Message-ID: <CAHndrB=R8OCikM+WZD_LizLWSbBOZc8izbcTJyWP_WCNYgAfww@mail.gmail.com> (raw)
In-Reply-To: <1467871749.3206.25.camel@themaw.net>

Sure, thank you for applying.

2016-07-07 15:09 GMT+09:00 Ian Kent <raven@themaw.net>:
> On Mon, 2016-07-04 at 12:40 +0900, Tomohiro Kusumi wrote:
>> It's invalid if the given mode is neither dir nor link,
>> so warn on else case.
>
> I've added this too.
>
> But ....
>
>>
>> (v2 changed BUG_ON to WARN_ON)
>>
>> Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
>> ---
>>  fs/autofs4/inode.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c
>> index ad0ee93..89174ec 100644
>> --- a/fs/autofs4/inode.c
>> +++ b/fs/autofs4/inode.c
>> @@ -305,6 +305,7 @@ int autofs4_fill_super(struct super_block *s, void *data,
>> int silent)
>>       if (autofs_type_trigger(sbi->type))
>>               __managed_dentry_set_managed(root);
>>
>> +     WARN_ON(!root_inode->i_fop || !root_inode->i_op);
>
> I'm dropping this.
>
> We know for a fact that this is a directory inode because above it was created
> with autofs4_get_inode(s, S_IFDIR | 0755) and here the operations are changed to
> those specific to the root inode.
>
>>       root_inode->i_fop = &autofs4_root_operations;
>>       root_inode->i_op = &autofs4_dir_inode_operations;
>>
>> @@ -368,7 +369,8 @@ struct inode *autofs4_get_inode(struct super_block *sb,
>> umode_t mode)
>>               inode->i_fop = &autofs4_dir_operations;
>>       } else if (S_ISLNK(mode)) {
>>               inode->i_op = &autofs4_symlink_inode_operations;
>> -     }
>> +     } else
>> +             WARN_ON(1);
>>
>>       return inode;
>>  }
--
To unsubscribe from this list: send the line "unsubscribe autofs" in

      reply	other threads:[~2016-07-07  6:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-04  3:40 [PATCH v2] autofs: Add WARN_ON(1) for non dir/link inode case Tomohiro Kusumi
2016-07-07  6:09 ` Ian Kent
2016-07-07  6:46   ` Tomohiro Kusumi [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='CAHndrB=R8OCikM+WZD_LizLWSbBOZc8izbcTJyWP_WCNYgAfww@mail.gmail.com' \
    --to=kusumi.tomohiro@gmail.com \
    --cc=autofs@vger.kernel.org \
    --cc=jeffm@suse.com \
    --cc=raven@themaw.net \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).