Re: [PATCH] cifs: Detect errors in cifs_writepages when called from pdflush (V2)

Peter Schwenke <[email protected]>
Newsgroups gmane.linux.file-systems.cifs
Message-ID <[email protected]>
Jeff Layton wrote:
>> 					if (current_is_pdflush()) {
>> 						if (rc == -ENOSPC)
>> 							cifs_inode->write_behind_rc =  rc;
>> 						else
>> 							cifs_inode->write_behind_rc =  -EIO;
>> 					}
>>  				} else {
>>  					cifs_stats_bytes_written(cifs_sb->tcon,
>>  								 bytes_written);
> 
> Looking at this a little more closely...
> 
> I'm not sure that current_is_pdflush() the right check to use for this?
> Is it possible that we could get similar problem within the context of
> another thread? Should we instead check for whether writepages was
> called with WB_SYNC_NONE instead?
> 

Thanks, Jeff.  The  WB_SYNC_NONE is the correct check.  I've had a good
look at this and there are other cases where cifs_writepages could be
called and no return checked.  One of those is the fadvise64_64 system
call.

Patch follows.

Your comment got me thinking about multiple processes writing to the
same file.  I'll start a new thread on that.

-- 
                                                              Regards
                                                              ...Peter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.