diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/filesystems/porting | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting index 0f33c77bc14b..fbd3815a5f57 100644 --- a/Documentation/filesystems/porting +++ b/Documentation/filesystems/porting | |||
@@ -184,11 +184,19 @@ just takes the superblock and inode number as arguments and does the | |||
184 | test and set for you. | 184 | test and set for you. |
185 | 185 | ||
186 | e.g. | 186 | e.g. |
187 | inode = iget_locked(sb, ino); | 187 | inode = iget_locked(sb, ino); |
188 | if (inode->i_state & I_NEW) { | 188 | if (inode->i_state & I_NEW) { |
189 | read_inode_from_disk(inode); | 189 | err = read_inode_from_disk(inode); |
190 | unlock_new_inode(inode); | 190 | if (err < 0) { |
191 | } | 191 | iget_failed(inode); |
192 | return err; | ||
193 | } | ||
194 | unlock_new_inode(inode); | ||
195 | } | ||
196 | |||
197 | Note that if the process of setting up a new inode fails, then iget_failed() | ||
198 | should be called on the inode to render it dead, and an appropriate error | ||
199 | should be passed back to the caller. | ||
192 | 200 | ||
193 | --- | 201 | --- |
194 | [recommended] | 202 | [recommended] |