diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2008-12-02 13:40:11 +0100 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2009-04-02 12:29:52 +0200 |
commit | 87bc730c07a0884d14d6af5c9d49f4669c0a0589 (patch) | |
tree | aae3f3b6286526e16ee9614923d227612affe51e /fs/udf/super.c | |
parent | e650b94addfbf072952df762e6f1c6c9e26c4f9c (diff) | |
download | kernel_samsung_aries-87bc730c07a0884d14d6af5c9d49f4669c0a0589.zip kernel_samsung_aries-87bc730c07a0884d14d6af5c9d49f4669c0a0589.tar.gz kernel_samsung_aries-87bc730c07a0884d14d6af5c9d49f4669c0a0589.tar.bz2 |
udf: fix default mode and dmode options handling
On x86 (and several other archs) mode_t is defined as "unsigned short"
and comparing unsigned shorts to negative ints is broken (because short
is promoted to int and then compared). Fix it.
Reported-and-tested-by: Laurent Riffard <laurent.riffard@free.fr>
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r-- | fs/udf/super.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c index 0368bf6..b9dc6ad 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -284,9 +284,9 @@ static int udf_show_options(struct seq_file *seq, struct vfsmount *mnt) seq_printf(seq, ",gid=%u", sbi->s_gid); if (sbi->s_umask != 0) seq_printf(seq, ",umask=%o", sbi->s_umask); - if (sbi->s_fmode != -1) + if (sbi->s_fmode != UDF_INVALID_MODE) seq_printf(seq, ",mode=%o", sbi->s_fmode); - if (sbi->s_dmode != -1) + if (sbi->s_dmode != UDF_INVALID_MODE) seq_printf(seq, ",dmode=%o", sbi->s_dmode); if (UDF_QUERY_FLAG(sb, UDF_FLAG_SESSION_SET)) seq_printf(seq, ",session=%u", sbi->s_session); @@ -1892,8 +1892,8 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) uopt.uid = -1; uopt.gid = -1; uopt.umask = 0; - uopt.fmode = -1; - uopt.dmode = -1; + uopt.fmode = UDF_INVALID_MODE; + uopt.dmode = UDF_INVALID_MODE; sbi = kzalloc(sizeof(struct udf_sb_info), GFP_KERNEL); if (!sbi) |