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

Peter Schwenke peter at bluetoad.com.au
Fri Apr 24 21:56:03 GMT 2009


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


More information about the linux-cifs-client mailing list