diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2008-12-02 15:40:11 +0300 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2009-04-02 14:29:52 +0400 |
commit | 87bc730c07a0884d14d6af5c9d49f4669c0a0589 (patch) | |
tree | aae3f3b6286526e16ee9614923d227612affe51e /fs/udf/inode.c | |
parent | e650b94addfbf072952df762e6f1c6c9e26c4f9c (diff) | |
download | linux-87bc730c07a0884d14d6af5c9d49f4669c0a0589.tar.xz |
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/inode.c')
-rw-r--r-- | fs/udf/inode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 1456d238f8f8..e7533f785636 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -1223,10 +1223,10 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh) iinfo->i_lenExtents = inode->i_size; if (fe->icbTag.fileType != ICBTAG_FILE_TYPE_DIRECTORY && - sbi->s_fmode != -1) + sbi->s_fmode != UDF_INVALID_MODE) inode->i_mode = sbi->s_fmode; else if (fe->icbTag.fileType == ICBTAG_FILE_TYPE_DIRECTORY && - sbi->s_dmode != -1) + sbi->s_dmode != UDF_INVALID_MODE) inode->i_mode = sbi->s_dmode; else inode->i_mode = udf_convert_permissions(fe); |