From: Jonathan Corbet Date: Mon, 14 Jul 2008 21:29:34 +0000 (-0600) Subject: Merge commit 'v2.6.26' into bkl-removal X-Git-Tag: v2.6.27-rc1~1103^2 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=2fceef397f9880b212a74c418290ce69e7ac00eb;p=linux-2.6-omap-h63xx.git Merge commit 'v2.6.26' into bkl-removal --- 2fceef397f9880b212a74c418290ce69e7ac00eb diff --cc fs/fat/file.c index bdf91e97397,771326b8047..c672df4036e --- a/fs/fat/file.c +++ b/fs/fat/file.c @@@ -296,9 -307,11 +304,9 @@@ int fat_setattr(struct dentry *dentry, { struct msdos_sb_info *sbi = MSDOS_SB(dentry->d_sb); struct inode *inode = dentry->d_inode; - int mask, error = 0; + int error = 0; unsigned int ia_valid; - lock_kernel(); - /* * Expand the file. Since inode_setattr() updates ->i_size * before calling the ->truncate(), but FAT needs to fill the @@@ -341,16 -355,18 +350,17 @@@ goto out; } - error = inode_setattr(inode, attr); - if (error) - goto out; + /* + * We don't return -EPERM here. Yes, strange, but this is too + * old behavior. + */ + if (attr->ia_valid & ATTR_MODE) { + if (fat_sanitize_mode(sbi, inode, &attr->ia_mode) < 0) + attr->ia_valid &= ~ATTR_MODE; + } - if (S_ISDIR(inode->i_mode)) - mask = sbi->options.fs_dmask; - else - mask = sbi->options.fs_fmask; - inode->i_mode &= S_IFMT | (S_IRWXUGO & ~mask); + error = inode_setattr(inode, attr); out: - unlock_kernel(); return error; } EXPORT_SYMBOL_GPL(fat_setattr);