Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

NFS: Fix an Oops in nfs_setattr()

It looks like nfs_setattr() and nfs_rename() also need to test whether the
target is a regular file before calling nfs_wb_all()...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Trond Myklebust and committed by
Linus Torvalds
e1552e19 c9c57929

+6 -3
+2 -1
fs/nfs/dir.c
··· 1684 1684 * ... prune child dentries and writebacks if needed. 1685 1685 */ 1686 1686 if (atomic_read(&old_dentry->d_count) > 1) { 1687 - nfs_wb_all(old_inode); 1687 + if (S_ISREG(old_inode->i_mode)) 1688 + nfs_wb_all(old_inode); 1688 1689 shrink_dcache_parent(old_dentry); 1689 1690 } 1690 1691 nfs_inode_return_delegation(old_inode);
+4 -2
fs/nfs/inode.c
··· 341 341 lock_kernel(); 342 342 nfs_begin_data_update(inode); 343 343 /* Write all dirty data */ 344 - filemap_write_and_wait(inode->i_mapping); 345 - nfs_wb_all(inode); 344 + if (S_ISREG(inode->i_mode)) { 345 + filemap_write_and_wait(inode->i_mapping); 346 + nfs_wb_all(inode); 347 + } 346 348 /* 347 349 * Return any delegations if we're going to change ACLs 348 350 */